ソースを参照

HADOOP-5306. Fixes a problem to do with logging/parsing the http port of a lost tracker. Affects JobTracker restart. Contributed by Amar Kamat.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@748084 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 年 前
コミット
369ea143fe
2 ファイル変更9 行追加1 行削除
  1. 3 0
      CHANGES.txt
  2. 6 1
      src/mapred/org/apache/hadoop/mapred/JobTracker.java

+ 3 - 0
CHANGES.txt

@@ -899,6 +899,9 @@ Release 0.20.0 - Unreleased
     HADOOP-5272. Fixes a problem to do with detecting whether an attempt is the first
     attempt of a Task. This affects JobTracker restart. (Amar Kamat via ddas)
 
+    HADOOP-5306. Fixes a problem to do with logging/parsing the http port of a 
+    lost tracker. Affects JobTracker restart. (Amar Kamat via ddas)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

+ 6 - 1
src/mapred/org/apache/hadoop/mapred/JobTracker.java

@@ -936,7 +936,12 @@ public class JobTracker implements MRConstants, InterTrackerProtocol,
       String trackerName = attempt.get(Keys.TRACKER_NAME);
       String trackerHostName = 
         JobInProgress.convertTrackerNameToHostName(trackerName);
-      int port = attempt.getInt(Keys.HTTP_PORT);
+      // recover the port information.
+      int port = 0; // default to 0
+      String hport = attempt.get(Keys.HTTP_PORT);
+      if (hport != null && hport.length() > 0) {
+        port = attempt.getInt(Keys.HTTP_PORT);
+      }
       
       long attemptStartTime = attempt.getLong(Keys.START_TIME);