hadoop-common-commits mailing list archives

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

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

    Applying patch 2876967.mr733.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobInProgress.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=1076959&r1=1076958&r2=1076959&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:26:01 2011
@@ -1462,7 +1462,8 @@ class JobInProgress {
    * 
    * @param taskTracker task-tracker on which a task failed
    */
-  void addTrackerTaskFailure(String trackerName, TaskTracker taskTracker) {
+  synchronized void addTrackerTaskFailure(String trackerName, 
+                                          TaskTracker taskTracker) {
     if (flakyTaskTrackers < (clusterSize * CLUSTER_BLACKLIST_PERCENT)) { 
       String trackerHostName = convertTrackerNameToHostName(trackerName);
 
@@ -1478,8 +1479,12 @@ class JobInProgress {
         
         // Cancel reservations if appropriate
         if (taskTracker != null) {
-          taskTracker.unreserveSlots(TaskType.MAP, this);
-          taskTracker.unreserveSlots(TaskType.REDUCE, this);
+          if (trackersReservedForMaps.containsKey(taskTracker)) {
+            taskTracker.unreserveSlots(TaskType.MAP, this);
+          }
+          if (trackersReservedForReduces.containsKey(taskTracker)) {
+            taskTracker.unreserveSlots(TaskType.REDUCE, this);
+          }
         }
         LOG.info("TaskTracker at '" + trackerHostName + "' turned 'flaky'");
       }
@@ -2841,4 +2846,11 @@ class JobInProgress {
       return Values.REDUCE.name();
     }
   }
+  
+  /**
+   * Test method to set the cluster sizes
+   */
+  void setClusterSize(int clusterSize) {
+    this.clusterSize = clusterSize;
+  }
 }



Mime
View raw message