hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077401 - in /hadoop/common/branches/branch-0.20-security-patches/src: test/mapred/org/apache/hadoop/tools/rumen/ tools/org/apache/hadoop/tools/rumen/
Date Fri, 04 Mar 2011 04:11:16 GMT
Author: omalley
Date: Fri Mar  4 04:11:16 2011
New Revision: 1077401

URL: http://svn.apache.org/viewvc?rev=1077401&view=rev
Log:
commit dfb3d0dc801a3d968ba9d03e1f1afde993e52d9d
Author: Hong Tang <htang@yahoo-inc.com>
Date:   Fri Apr 16 13:40:04 2010 -0700

    Reverting the commit of MAPREDUCE-1317 since it broke the build
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1317. Reverting the patch since it caused build failures. (htang)
    +

Removed:
    hadoop/common/branches/branch-0.20-security-patches/src/test/mapred/org/apache/hadoop/tools/rumen/TestConcurrentRead.java
Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
    hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedLocation.java
    hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTask.java
    hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java?rev=1077401&r1=1077400&r2=1077401&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/HadoopLogsAnalyzer.java
Fri Mar  4 04:11:16 2011
@@ -1285,7 +1285,7 @@ public class HadoopLogsAnalyzer extends 
           attempt.setLocation(host.makeLoggedLocation());
         }
 
-        List<LoggedLocation> locs = task.getPreferredLocations();
+        ArrayList<LoggedLocation> locs = task.getPreferredLocations();
 
         if (host != null && locs != null) {
           for (LoggedLocation loc : locs) {

Modified: hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedLocation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedLocation.java?rev=1077401&r1=1077400&r2=1077401&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedLocation.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedLocation.java
Fri Mar  4 04:11:16 2011
@@ -18,10 +18,7 @@
 package org.apache.hadoop.tools.rumen;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -44,15 +41,12 @@ import org.codehaus.jackson.annotate.Jso
  * 
  */
 public class LoggedLocation implements DeepCompare {
-   static final Map<List<String>, List<String>> layersCache = 
-    new HashMap<List<String>, List<String>>();
-
   /**
    * The full path from the root of the network to the host.
    * 
    * NOTE that this assumes that the network topology is a tree.
    */
-  List<String> layers = Collections.emptyList();
+  List<String> layers = new ArrayList<String>();
 
   static private Set<String> alreadySeenAnySetterAttributes =
       new TreeSet<String>();
@@ -62,26 +56,7 @@ public class LoggedLocation implements D
   }
 
   void setLayers(List<String> layers) {
-    if (layers == null || layers.isEmpty()) {
-      this.layers = Collections.emptyList();
-    } else {
-      synchronized (layersCache) {
-        List<String> found = layersCache.get(layers);
-        if (found == null) {
-          // make a copy with interned string.
-          List<String> clone = new ArrayList<String>(layers.size());
-          for (String s : layers) {
-            clone.add(s.intern());
-          }
-          // making it read-only as we are sharing them.
-          List<String> readonlyLayers = Collections.unmodifiableList(clone);
-          layersCache.put(readonlyLayers, readonlyLayers);
-          this.layers = readonlyLayers;
-        } else {
-          this.layers = found;
-        }
-      }
-    }
+    this.layers = layers;
   }
 
   @SuppressWarnings("unused")

Modified: hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTask.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTask.java?rev=1077401&r1=1077400&r2=1077401&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTask.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTask.java
Fri Mar  4 04:11:16 2011
@@ -18,7 +18,6 @@
 package org.apache.hadoop.tools.rumen;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
@@ -45,7 +44,9 @@ public class LoggedTask implements DeepC
   Pre21JobHistoryConstants.Values taskType;
   Pre21JobHistoryConstants.Values taskStatus;
   List<LoggedTaskAttempt> attempts = new ArrayList<LoggedTaskAttempt>();
-  List<LoggedLocation> preferredLocations = Collections.emptyList();
+
+  ArrayList<LoggedLocation> preferredLocations =
+      new ArrayList<LoggedLocation>();
 
   int numberMaps = -1;
   int numberReduces = -1;
@@ -129,23 +130,15 @@ public class LoggedTask implements DeepC
   }
 
   void setAttempts(List<LoggedTaskAttempt> attempts) {
-    if (attempts == null) {
-      this.attempts = new ArrayList<LoggedTaskAttempt>();
-    } else {
-      this.attempts = attempts;
-    }
+    this.attempts = attempts;
   }
 
-  public List<LoggedLocation> getPreferredLocations() {
+  public ArrayList<LoggedLocation> getPreferredLocations() {
     return preferredLocations;
   }
 
-  void setPreferredLocations(List<LoggedLocation> preferredLocations) {
-    if (preferredLocations == null || preferredLocations.isEmpty()) {
-      this.preferredLocations = Collections.emptyList();
-    } else {
-      this.preferredLocations = preferredLocations;
-    }
+  void setPreferredLocations(ArrayList<LoggedLocation> preferredLocations) {
+    this.preferredLocations = preferredLocations;
   }
 
   public int getNumberMaps() {
@@ -211,8 +204,8 @@ public class LoggedTask implements DeepC
     }
   }
 
-  private void compareLoggedLocations(List<LoggedLocation> c1,
-      List<LoggedLocation> c2, TreePath loc, String eltname)
+  private void compareLoggedLocations(ArrayList<LoggedLocation> c1,
+      ArrayList<LoggedLocation> c2, TreePath loc, String eltname)
       throws DeepInequalityException {
     if (c1 == null && c2 == null) {
       return;

Modified: hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java?rev=1077401&r1=1077400&r2=1077401&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
Fri Mar  4 04:11:16 2011
@@ -135,7 +135,7 @@ public class LoggedTaskAttempt implement
   }
 
   void setHostName(String hostName) {
-    this.hostName = hostName.intern();
+    this.hostName = hostName;
   }
 
   public long getHdfsBytesRead() {



Mime
View raw message