You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ac...@apache.org on 2007/09/15 09:55:28 UTC

svn commit: r575889 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobTracker.java

Author: acmurthy
Date: Sat Sep 15 00:55:27 2007
New Revision: 575889

URL: http://svn.apache.org/viewvc?rev=575889&view=rev
Log:
HADOOP-1892.  Fix a NullPointerException in the JobTracker when trying to fetch a task's diagnostic messages from the JobClient.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=575889&r1=575888&r2=575889&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Sat Sep 15 00:55:27 2007
@@ -140,6 +140,10 @@
     HADOOP-1889.  Fix path in EC2 scripts for building your own AMI.
     (tomwhite)
 
+    HADOOP-1892.  Fix a NullPointerException in the JobTracker when
+    trying to fetch a task's diagnostic messages from the JobClient.
+    (Amar Kamat via acmurthy)
+
   IMPROVEMENTS
 
     HADOOP-1266. Remove dependency of package org.apache.hadoop.net on 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=575889&r1=575888&r2=575889&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Sat Sep 15 00:55:27 2007
@@ -1653,9 +1653,10 @@
    * @param taskId the id of the task
    * @return an array of the diagnostic messages
    */
-  public synchronized String[] getTaskDiagnostics(String jobId,
-                                                      String tipId,
-                                                      String taskId) throws IOException {
+  public synchronized String[] getTaskDiagnostics(String jobId, 
+                                                  String tipId, 
+                                                  String taskId) 
+  throws IOException {
     JobInProgress job = jobs.get(jobId);
     if (job == null) {
       throw new IllegalArgumentException("Job " + jobId + " not found.");
@@ -1664,7 +1665,9 @@
     if (tip == null) {
       throw new IllegalArgumentException("TIP " + tipId + " not found.");
     }
-    return tip.getDiagnosticInfo(taskId).toArray(new String[0]);
+    List<String> taskDiagnosticInfo = tip.getDiagnosticInfo(taskId);
+    return ((taskDiagnosticInfo == null) ? null 
+            : taskDiagnosticInfo.toArray(new String[0]));
   }
     
   /** Get all the TaskStatuses from the tipid. */