pgandhi999 commented on a change in pull request #23677: 
[SPARK-26755][SCHEDULER] : Optimize Spark Scheduler to dequeue speculative 
tasks…
URL: https://github.com/apache/spark/pull/23677#discussion_r299163920
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
 ##########
 @@ -269,6 +281,28 @@ private[spark] class TaskSetManager(
     allPendingTasks += index  // No point scanning this whole list to find the 
old task there
   }
 
+  private[spark] def addPendingSpeculativeTask(index: Int) {
+    for (loc <- tasks(index).preferredLocations) {
+      loc match {
+        case e: ExecutorCacheTaskLocation =>
+          pendingSpeculatableTasksForExecutor.getOrElseUpdate(
+            e.executorId, new HashSet) += index
+        case _ =>
+      }
+      pendingSpeculatableTasksForHost.getOrElseUpdate(loc.host, new HashSet) 
+= index
+      for (rack <- sched.getRackForHost(loc.host)) {
+        pendingSpeculatableTasksForRack.getOrElseUpdate(rack, new HashSet) += 
index
+      }
+    }
+
+    if (tasks(index).preferredLocations == Nil) {
+        pendingSpeculatableTasksWithNoPrefs += index
+    }
+
+    // No point scanning this whole list to find the old task there
 
 Review comment:
   Done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to