hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ama...@apache.org
Subject svn commit: r1199105 - in /hadoop/common/trunk/hadoop-mapreduce-project: CHANGES.txt src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
Date Tue, 08 Nov 2011 04:44:25 GMT
Author: amarrk
Date: Tue Nov  8 04:44:25 2011
New Revision: 1199105

URL: http://svn.apache.org/viewvc?rev=1199105&view=rev
Log:
[Rumen] LoggedTaskAttempt#getHostName() returns null. (amarrk)

Modified:
    hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java

Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1199105&r1=1199104&r2=1199105&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Tue Nov  8 04:44:25 2011
@@ -29,6 +29,8 @@ Trunk (unreleased changes)
     uri with no authority. (John George via jitendra)
 
   BUG FIXES
+    MAPREDUCE-3346. [Rumen] LoggedTaskAttempt#getHostName() returns null. 
+                    (amarrk)
 
     MAPREDUCE-2950. [Gridmix] TestUserResolve fails in trunk. 
                     (Ravi Gummadi via amarrk)

Modified: hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java?rev=1199105&r1=1199104&r2=1199105&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/src/tools/org/apache/hadoop/tools/rumen/LoggedTaskAttempt.java
Tue Nov  8 04:44:25 2011
@@ -328,11 +328,27 @@ public class LoggedTaskAttempt implement
     return hostName;
   }
 
-
+  void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+  
   // hostName is saved in the format rackName/NodeName
   void setHostName(String hostName, String rackName) {
-    this.hostName = hostName == null || rackName == null ? null
-        : rackName.intern() + "/" + hostName.intern();
+    if (hostName == null || hostName.length() == 0) {
+      throw new RuntimeException("Invalid entry! Missing hostname");
+    } else if (rackName == null || rackName.length() == 0) {
+      setHostName(hostName);
+    } else {
+      // make sure that the rackname is prefixed with a '/'
+      if (!rackName.startsWith("/")) {
+        rackName = "/" + rackName;
+      }
+      // make sure that the hostname is prefixed with a '/'
+      if (!hostName.startsWith("/")) {
+        hostName = "/" + hostName;
+      }
+      setHostName(rackName.intern() + hostName.intern());
+    }
   }
 
   public long getHdfsBytesRead() {



Mime
View raw message