hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1135328 - in /hadoop/common/branches/MR-279/mapreduce: ./ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/jo...
Date Mon, 13 Jun 2011 22:26:03 GMT
Author: mahadev
Date: Mon Jun 13 22:26:03 2011
New Revision: 1135328

URL: http://svn.apache.org/viewvc?rev=1135328&view=rev
Log:
Fix NPE in history event handling (siddharth seth via mahadev)

Modified:
    hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java

Modified: hadoop/common/branches/MR-279/mapreduce/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/CHANGES.txt?rev=1135328&r1=1135327&r2=1135328&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/CHANGES.txt (original)
+++ hadoop/common/branches/MR-279/mapreduce/CHANGES.txt Mon Jun 13 22:26:03 2011
@@ -4,6 +4,9 @@ Trunk (unreleased changes)
 
 
     MAPREDUCE-279
+   
+    Fix NPE in history event handling (siddharth seth via mahadev)
+    
     Job level node blacklisting. (sharad)
 
     Fixing the bug which was causing FAILED jobs to be displayed as COMPLETED

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java?rev=1135328&r1=1135327&r2=1135328&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/JobHistoryEventHandler.java
Mon Jun 13 22:26:03 2011
@@ -133,19 +133,23 @@ public class JobHistoryEventHandler exte
       // This directory will be in a common location, or this may be a cluster
       // meant for a single user. Creating based on the conf. Should ideally be
       // created by the JobHistoryServer or as part of deployment.
+      if (!doneDirFS.exists(doneDirPath)) {
       if (JobHistoryUtils.shouldCreateNonUserDirectory(conf)) {
         LOG.info("Creating intermediate history logDir: ["
             + doneDirPath
             + "] + based on conf. Should ideally be created by the JobHistoryServer: "
             + JHConfig.CREATE_HISTORY_INTERMEDIATE_BASE_DIR_KEY);
-        mkdir(doneDirFS, doneDirPath, new FsPermission(
+          mkdir(
+              doneDirFS,
+              doneDirPath,
+              new FsPermission(
             JobHistoryUtils.HISTORY_INTERMEDIATE_DONE_DIR_PERMISSIONS
                 .toShort()));
-        // TODO Temporary toShort till new FsPermission(FsPermissions) respects
+          // TODO Temporary toShort till new FsPermission(FsPermissions)
+          // respects
         // sticky
       } else {
-        String message =
-            "Not creating intermediate history logDir: ["
+          String message = "Not creating intermediate history logDir: ["
                 + doneDirPath
                 + "] based on conf: "
                 + JHConfig.CREATE_HISTORY_INTERMEDIATE_BASE_DIR_KEY
@@ -153,6 +157,7 @@ public class JobHistoryEventHandler exte
         LOG.error(message);
         throw new YarnException(message);
       }
+      }
     } catch (IOException e) {
       LOG.error("Failed checking for the existance of history intermediate done directory:
["
           + doneDirPath + "]");

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java?rev=1135328&r1=1135327&r2=1135328&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java
Mon Jun 13 22:26:03 2011
@@ -866,7 +866,7 @@ public abstract class TaskAttemptImpl im
         TypeConverter.fromYarn(taskAttempt.attemptId),
         TypeConverter.fromYarn(taskAttempt.attemptId.getTaskId().getTaskType()),
         attemptState.toString(), taskAttempt.finishTime,
-        taskAttempt.containerMgrAddress,
+        taskAttempt.containerMgrAddress == null ? "UNKNOWN" : taskAttempt.containerMgrAddress,
         taskAttempt.reportedStatus.diagnosticInfo.toString());
       //TODO Different constructor - allSplits
     return tauce;
@@ -1103,7 +1103,7 @@ public abstract class TaskAttemptImpl im
          TypeConverter.fromYarn(attemptId.getTaskId().getTaskType()),
          state.toString(),
          finishTime, //TODO TaskAttemptStatus changes. MapFinishTime
-         finishTime, this.containerMgrAddress,
+         finishTime, this.containerMgrAddress == null ? "UNKNOWN" : this.containerMgrAddress,
          state.toString(), //TODO state is a progress string.
          TypeConverter.fromYarn(getCounters()),null);
          eventHandler.handle(
@@ -1115,7 +1115,7 @@ public abstract class TaskAttemptImpl im
          state.toString(),
          finishTime, //TODO TaskAttemptStatus changes. ShuffleFinishTime
          finishTime, //TODO TaskAttemptStatus changes. SortFinishTime
-         finishTime, this.containerMgrAddress,
+         finishTime, this.containerMgrAddress == null ? "UNKNOWN" : this.containerMgrAddress,
          state.toString(),
          TypeConverter.fromYarn(getCounters()),null);
          eventHandler.handle(



Mime
View raw message