Kaynağa Gözat

HADOOP-1907. Fixes null pointer exception while getting the task diagnostics
in the JobClient. Contributed by Christian Kunz.


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@577171 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 18 yıl önce
ebeveyn
işleme
1e03e277ff

+ 3 - 0
CHANGES.txt

@@ -152,6 +152,9 @@ Trunk (unreleased changes)
     HADOOP-1897.  Fix links to about.html page from other pages in 
     the web site. (enis)
 
+    HADOOP-1907.  Fix null pointer exception when getting task diagnostics
+    in JobClient. (Christian Kunz via omalley)
+
   IMPROVEMENTS
 
     HADOOP-1266. Remove dependency of package org.apache.hadoop.net on 

+ 4 - 2
src/java/org/apache/hadoop/mapred/JobClient.java

@@ -648,8 +648,10 @@ public class JobClient extends Configured implements MRConstants, Tool  {
                   String[] taskDiagnostics = 
                 	  jc.jobSubmitClient.getTaskDiagnostics(jobId, tipId, 
                 			                                taskId); 
-                  for(String diagnostics : taskDiagnostics){
-                   	System.err.println(diagnostics);
+                  if (taskDiagnostics != null) {
+                    for(String diagnostics : taskDiagnostics){
+                   	  System.err.println(diagnostics);
+                    }
                   }
                   // Displaying the task logs
                   displayTaskLogs(event.getTaskId(), event.getTaskTrackerHttp());