Browse Source

HADOOP-5565. Add API for failing/finalized jobs to the JT metrics
instrumentation. Contributed by Jerome Boulon


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@758423 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 16 years ago
parent
commit
f7fc6a49f5

+ 3 - 0
CHANGES.txt

@@ -799,6 +799,9 @@ Release 0.20.0 - Unreleased
     HADOOP-5564. Limit the JVM heap size in the java command for initializing
     JAVA_PLATFORM.  (Suresh Srinivas via szetszwo)
 
+    HADOOP-5565. Add API for failing/finalized jobs to the JT metrics
+    instrumentation. (Jerome Boulon via cdouglas)
+
 Release 0.19.2 - Unreleased
 
   BUG FIXES

+ 2 - 0
src/mapred/org/apache/hadoop/mapred/JobInProgress.java

@@ -2114,6 +2114,7 @@ class JobInProgress {
   }
   
   private synchronized void terminateJob(int jobTerminationState) {
+    final JobTrackerInstrumentation metrics = jobtracker.getInstrumentation();
     if ((status.getRunState() == JobStatus.RUNNING) ||
         (status.getRunState() == JobStatus.PREP)) {
       if (jobTerminationState == JobStatus.FAILED) {
@@ -2134,6 +2135,7 @@ class JobInProgress {
                                      this.finishedReduceTasks);
       }
       garbageCollect();
+      metrics.terminateJob(this.conf, this.status.getJobID());
     }
   }
 

+ 3 - 0
src/mapred/org/apache/hadoop/mapred/JobTracker.java

@@ -1894,6 +1894,9 @@ public class JobTracker implements MRConstants, InterTrackerProtocol,
       LOG.info("Failed to finalize the log file recovery for job " + id, ioe);
     }
 
+    final JobTrackerInstrumentation metrics = getInstrumentation();
+    metrics.finalizeJob(conf, id);
+    
     long now = System.currentTimeMillis();
     
     // mark the job for cleanup at all the trackers

+ 6 - 0
src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java

@@ -49,6 +49,12 @@ class JobTrackerInstrumentation {
   public void completeJob(JobConf conf, JobID id) 
   { }
 
+  public void terminateJob(JobConf conf, JobID id) 
+  { }
+  
+  public void finalizeJob(JobConf conf, JobID id) 
+  { }
+  
   public void addWaiting(JobID id, int tasks)
   { }