squito commented on a change in pull request #23951: [SPARK-13704][CORE][YARN] 
Re-implement RackResolver to reduce resolving time
URL: https://github.com/apache/spark/pull/23951#discussion_r266923126
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
 ##########
 @@ -250,8 +251,10 @@ private[spark] class TaskSetManager(
       }
       pendingTasksForHost.getOrElseUpdate(loc.host, new ArrayBuffer) += index
 
-      initializingTaskArray match {
-        case Some(array) => array += ((loc.host, index))
+      initializingHostToIndices match {
+        case Some(hostToIndices) =>
+          // when TaskSetManager initializing, preferredLocation -> task 
indices
+          hostToIndices.getOrElseUpdate(loc.host, new ArrayBuffer) += index
 
 Review comment:
   To be clear, you would still need to pass in another argument to 
`addPendingTask`, to control whether or not you add to `pendingTasksForRack`, 
but it could just be `initializing: Boolean`
   (sorry for the back and forth on this)

----------------------------------------------------------------
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