hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1076936 - in /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred: JobInProgress.java JobTrackerInstrumentation.java JobTrackerMetricsInst.java
Date Fri, 04 Mar 2011 03:23:55 GMT
Author: omalley
Date: Fri Mar  4 03:23:55 2011
New Revision: 1076936

URL: http://svn.apache.org/viewvc?rev=1076936&view=rev
Log:
commit afeb3d314b00392219232c12f6c39b8de0e959ef
Author: Lee Tucker <ltucker@yahoo-inc.com>
Date:   Thu Jul 30 17:40:21 2009 -0700

    Applying patch 2730508.5738.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.java?rev=1076936&r1=1076935&r2=1076936&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.java
Fri Mar  4 03:23:55 2011
@@ -441,8 +441,8 @@ class JobInProgress {
                 (numMapTasks + numReduceTasks) +
                 " exceeds the configured limit " + maxTasks);
     }
-    jobtracker.getInstrumentation().addWaiting(
-        getJobID(), numMapTasks + numReduceTasks);
+    jobtracker.getInstrumentation().addWaitingMaps(getJobID(), numMapTasks);
+    jobtracker.getInstrumentation().addWaitingReduces(getJobID(), numReduceTasks);
 
     maps = new TaskInProgress[numMapTasks];
     for(int i=0; i < numMapTasks; ++i) {
@@ -2490,8 +2490,8 @@ class JobInProgress {
    */
   synchronized void garbageCollect() {
     // Let the JobTracker know that a job is complete
-    jobtracker.getInstrumentation(
-        ).decWaiting(getJobID(), pendingMaps() + pendingReduces());
+    jobtracker.getInstrumentation().decWaitingMaps(getJobID(), pendingMaps());
+    jobtracker.getInstrumentation().decWaitingReduces(getJobID(), pendingReduces());
     jobtracker.storeCompletedJob(this);
     jobtracker.finalizeJob(this);
       

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java?rev=1076936&r1=1076935&r2=1076936&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
Fri Mar  4 03:23:55 2011
@@ -55,9 +55,15 @@ class JobTrackerInstrumentation {
   public void finalizeJob(JobConf conf, JobID id) 
   { }
   
-  public void addWaiting(JobID id, int tasks)
+  public void addWaitingMaps(JobID id, int task)
   { }
-
-  public void decWaiting(JobID id, int tasks)
+  
+  public void decWaitingMaps(JobID id, int task) 
+  { }
+  
+  public void addWaitingReduces(JobID id, int task)
+  { }
+  
+  public void decWaitingReduces(JobID id, int task)
   { }
 }

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java?rev=1076936&r1=1076935&r2=1076936&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
Fri Mar  4 03:23:55 2011
@@ -36,8 +36,9 @@ class JobTrackerMetricsInst extends JobT
   private int numReduceTasksFailed = 0;
   private int numJobsSubmitted = 0;
   private int numJobsCompleted = 0;
-  private int numWaitingTasks = 0;
-    
+  private int numWaitingMaps = 0;
+  private int numWaitingReduces = 0;
+  
   public JobTrackerMetricsInst(JobTracker tracker, JobConf conf) {
     super(tracker, conf);
     String sessionId = conf.getSessionId();
@@ -64,7 +65,8 @@ class JobTrackerMetricsInst extends JobT
       metricsRecord.incrMetric("reduces_failed", numReduceTasksFailed);
       metricsRecord.incrMetric("jobs_submitted", numJobsSubmitted);
       metricsRecord.incrMetric("jobs_completed", numJobsCompleted);
-      metricsRecord.incrMetric("waiting_tasks", numWaitingTasks);
+      metricsRecord.incrMetric("waiting_maps", numWaitingMaps);
+      metricsRecord.incrMetric("waiting_reduces", numWaitingReduces);
 
       numMapTasksLaunched = 0;
       numMapTasksCompleted = 0;
@@ -72,9 +74,10 @@ class JobTrackerMetricsInst extends JobT
       numReduceTasksLaunched = 0;
       numReduceTasksCompleted = 0;
       numReduceTasksFailed = 0;
-      numWaitingTasks = 0;
       numJobsSubmitted = 0;
       numJobsCompleted = 0;
+      numWaitingMaps = 0;
+      numWaitingReduces = 0;
     }
     metricsRecord.update();
 
@@ -88,7 +91,7 @@ class JobTrackerMetricsInst extends JobT
   @Override
   public synchronized void launchMap(TaskAttemptID taskAttemptID) {
     ++numMapTasksLaunched;
-    decWaiting(taskAttemptID.getJobID(), 1);
+    decWaitingMaps(taskAttemptID.getJobID(), 1);
   }
 
   @Override
@@ -99,13 +102,13 @@ class JobTrackerMetricsInst extends JobT
   @Override
   public synchronized void failedMap(TaskAttemptID taskAttemptID) {
     ++numMapTasksFailed;
-    addWaiting(taskAttemptID.getJobID(), 1);
+    addWaitingMaps(taskAttemptID.getJobID(), 1);
   }
 
   @Override
   public synchronized void launchReduce(TaskAttemptID taskAttemptID) {
     ++numReduceTasksLaunched;
-    decWaiting(taskAttemptID.getJobID(), 1);
+    decWaitingReduces(taskAttemptID.getJobID(), 1);
   }
 
   @Override
@@ -116,7 +119,7 @@ class JobTrackerMetricsInst extends JobT
   @Override
   public synchronized void failedReduce(TaskAttemptID taskAttemptID) {
     ++numReduceTasksFailed;
-    addWaiting(taskAttemptID.getJobID(), 1);
+    addWaitingReduces(taskAttemptID.getJobID(), 1);
   }
 
   @Override
@@ -130,12 +133,22 @@ class JobTrackerMetricsInst extends JobT
   }
 
   @Override
-  public synchronized void addWaiting(JobID id, int tasks) {
-    numWaitingTasks += tasks;
+  public synchronized void addWaitingMaps(JobID id, int task) {
+    numWaitingMaps  += task;
   }
-
+  
+  @Override
+  public synchronized void decWaitingMaps(JobID id, int task) {
+    numWaitingMaps -= task;
+  }
+  
+  @Override
+  public synchronized void addWaitingReduces(JobID id, int task) {
+    numWaitingReduces += task;
+  }
+  
   @Override
-  public synchronized void decWaiting(JobID id, int tasks) {
-    numWaitingTasks -= tasks;
+  public synchronized void decWaitingReduces(JobID id, int task){
+    numWaitingReduces -= task;
   }
 }



Mime
View raw message