@@ -180,20 +180,13 @@ private[spark] class TaskSetManager(
180180 }
181181 }
182182
183- var hadAliveLocations = false
184183 for (loc <- tasks(index).preferredLocations) {
185184 for (execId <- loc.executorId) {
186185 addTo(pendingTasksForExecutor.getOrElseUpdate(execId, new ArrayBuffer ))
187186 }
188- if (sched.hasExecutorsAliveOnHost(loc.host)) {
189- hadAliveLocations = true
190- }
191187 addTo(pendingTasksForHost.getOrElseUpdate(loc.host, new ArrayBuffer ))
192188 for (rack <- sched.getRackForHost(loc.host)) {
193189 addTo(pendingTasksForRack.getOrElseUpdate(rack, new ArrayBuffer ))
194- if (sched.hasHostAliveOnRack(rack)){
195- hadAliveLocations = true
196- }
197190 }
198191 }
199192
@@ -286,7 +279,7 @@ private[spark] class TaskSetManager(
286279 ! hasAttemptOnHost(index, host) && ! executorIsBlacklisted(execId, index)
287280
288281 if (! speculatableTasks.isEmpty) {
289- // Check for process-local or preference-less tasks; note that tasks can be process-local
282+ // Check for process-local tasks; note that tasks can be process-local
290283 // on multiple nodes when we replicate cached blocks, as in Spark Streaming
291284 for (index <- speculatableTasks if canRunOnHost(index)) {
292285 val prefs = tasks(index).preferredLocations
@@ -308,6 +301,7 @@ private[spark] class TaskSetManager(
308301 }
309302 }
310303
304+ // Check for no-preference tasks
311305 if (TaskLocality .isAllowed(locality, TaskLocality .NO_PREF )) {
312306 for (index <- speculatableTasks if canRunOnHost(index)) {
313307 val locations = tasks(index).preferredLocations
@@ -350,7 +344,7 @@ private[spark] class TaskSetManager(
350344 * @return An option containing (task index within the task set, locality, is speculative?)
351345 */
352346 private def findTask (execId : String , host : String , maxLocality : TaskLocality .Value )
353- : Option [(Int , TaskLocality .Value , Boolean )] =
347+ : Option [(Int , TaskLocality .Value , Boolean )] =
354348 {
355349 for (index <- findTaskFromList(execId, getPendingTasksForExecutor(execId))) {
356350 return Some ((index, TaskLocality .PROCESS_LOCAL , false ))
@@ -392,7 +386,7 @@ private[spark] class TaskSetManager(
392386 /**
393387 * Respond to an offer of a single executor from the scheduler by finding a task
394388 *
395- * NOTE: this function is either called with a real preferredLocality level which
389+ * NOTE: this function is either called with a maxLocality which
396390 * would be adjusted by delay scheduling algorithm or it will be with a special
397391 * NO_PREF locality which will be not modified
398392 *
0 commit comments