Permalink
Browse files

Applying patch 2730508.5738.patch

  • Loading branch information...
1 parent 8c4d684 commit eafbd7533ee872e708f0ad756eefc7bb230fdd00 Lee Tucker committed Jun 8, 2009
@@ -430,8 +430,8 @@ public synchronized void initTasks() throws IOException {
(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) {
@@ -2464,8 +2464,8 @@ public void failedTask(TaskInProgress tip, TaskAttemptID taskid, String reason,
*/
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);
@@ -55,9 +55,15 @@ public void terminateJob(JobConf conf, JobID id)
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)
{ }
}
@@ -36,8 +36,9 @@
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,17 +65,19 @@ public void doUpdates(MetricsContext unused) {
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;
numMapTasksFailed = 0;
numReduceTasksLaunched = 0;
numReduceTasksCompleted = 0;
numReduceTasksFailed = 0;
- numWaitingTasks = 0;
numJobsSubmitted = 0;
numJobsCompleted = 0;
+ numWaitingMaps = 0;
+ numWaitingReduces = 0;
}
metricsRecord.update();
@@ -88,7 +91,7 @@ public void doUpdates(MetricsContext unused) {
@Override
public synchronized void launchMap(TaskAttemptID taskAttemptID) {
++numMapTasksLaunched;
- decWaiting(taskAttemptID.getJobID(), 1);
+ decWaitingMaps(taskAttemptID.getJobID(), 1);
}
@Override
@@ -99,13 +102,13 @@ public synchronized void completeMap(TaskAttemptID taskAttemptID) {
@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 @@ public synchronized void completeReduce(TaskAttemptID taskAttemptID) {
@Override
public synchronized void failedReduce(TaskAttemptID taskAttemptID) {
++numReduceTasksFailed;
- addWaiting(taskAttemptID.getJobID(), 1);
+ addWaitingReduces(taskAttemptID.getJobID(), 1);
}
@Override
@@ -130,12 +133,22 @@ public synchronized void completeJob(JobConf conf, JobID id) {
}
@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;
}
}

0 comments on commit eafbd75

Please sign in to comment.