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 cd...@apache.org on 2009/04/02 00:01:48 UTC

svn commit: r761083 - in /hadoop/core/branches/branch-0.20: CHANGES.txt src/mapred/org/apache/hadoop/mapred/JobInProgress.java

Author: cdouglas
Date: Wed Apr  1 22:01:48 2009
New Revision: 761083

URL: http://svn.apache.org/viewvc?rev=761083&view=rev
Log:
HADOOP-5607. Fix NPE in TestCapacityScheduler.

Modified:
    hadoop/core/branches/branch-0.20/CHANGES.txt
    hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=761083&r1=761082&r2=761083&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Wed Apr  1 22:01:48 2009
@@ -832,6 +832,8 @@
     the running job's information printed to the user's stdout as it runs.
     (omalley)
 
+    HADOOP-5607. Fix NPE in TestCapacityScheduler. (cdouglas)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=761083&r1=761082&r2=761083&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java (original)
+++ hadoop/core/branches/branch-0.20/src/mapred/org/apache/hadoop/mapred/JobInProgress.java Wed Apr  1 22:01:48 2009
@@ -95,7 +95,7 @@
   private volatile boolean jobFailed = false;
 
   JobPriority priority = JobPriority.NORMAL;
-  JobTracker jobtracker = null;
+  final JobTracker jobtracker;
 
   // NetworkTopology Node to the set of TIPs
   Map<Node, List<TaskInProgress>> nonRunningMapCache;
@@ -213,6 +213,7 @@
     this.numReduceTasks = conf.getNumReduceTasks();
     this.maxLevel = NetworkTopology.DEFAULT_HOST_LEVEL;
     this.anyCacheLevel = this.maxLevel+1;
+    this.jobtracker = null;
   }
   
   /**
@@ -2117,7 +2118,6 @@
   }
   
   private synchronized void terminateJob(int jobTerminationState) {
-    final JobTrackerInstrumentation metrics = jobtracker.getInstrumentation();
     if ((status.getRunState() == JobStatus.RUNNING) ||
         (status.getRunState() == JobStatus.PREP)) {
       if (jobTerminationState == JobStatus.FAILED) {
@@ -2138,7 +2138,8 @@
                                      this.finishedReduceTasks);
       }
       garbageCollect();
-      metrics.terminateJob(this.conf, this.status.getJobID());
+      jobtracker.getInstrumentation().terminateJob(
+          this.conf, this.status.getJobID());
     }
   }