You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/07/31 22:27:06 UTC

svn commit: r1367754 - /incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java

Author: benh
Date: Tue Jul 31 20:27:06 2012
New Revision: 1367754

URL: http://svn.apache.org/viewvc?rev=1367754&view=rev
Log:
Consider failed maps runnable when determining wheter to launch map
tasks (contributed by Charles Reiss,
https://reviews.apache.org/r/6187).

Modified:
    incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java

Modified: incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java?rev=1367754&r1=1367753&r2=1367754&view=diff
==============================================================================
--- incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java (original)
+++ incubator/mesos/trunk/hadoop/mesos/src/java/org/apache/hadoop/mapred/FrameworkScheduler.java Tue Jul 31 20:27:06 2012
@@ -379,24 +379,19 @@ public class FrameworkScheduler implemen
       neededMaps += 1;
 
     if (unassignedMaps < neededMaps) {
-      /*
-      // Figure out what locality level to allow using delay scheduling
-      long now = System.currentTimeMillis();
-      if (lastCanLaunchMapTime == -1)
-        lastCanLaunchMapTime = now;
-      int maxLevel; // Cache level to search for maps in
-      if (lastMapWasLocal) {
-        timeWaitedForLocalMap += now - lastCanLaunchMapTime;
-        if (timeWaitedForLocalMap >= localityWait) {
-          maxLevel = Integer.MAX_VALUE;
-        } else {
-          maxLevel = 1;
+      // 0. check for a failed map task to place. These tasks are not included
+      // in the "normal" lists of tasks in the JobInProgress object.
+      for (JobInProgress job: jobs) {
+        int state = job.getStatus().getRunState();
+        if (job.failedMaps != null && state == JobStatus.RUNNING) {
+          for (TaskInProgress tip : job.failedMaps) {
+            if (!tip.hasFailedOnMachine(host)) {
+              return true;
+            }
+          }
         }
-      } else {
-        maxLevel = Integer.MAX_VALUE;
       }
-      lastCanLaunchMapTime = now;
-      */
+
       int maxLevel = Integer.MAX_VALUE;
       // Look for a map with the required level
       for (JobInProgress job: jobs) {