You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/18 17:18:20 UTC

[GitHub] [spark] squito commented on a change in pull request #23951: [SPARK-13704][CORE][YARN] Re-implement RackResolver to reduce resolving time

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_r266524015
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
 ##########
 @@ -190,14 +190,15 @@ private[spark] class TaskSetManager(
 
   private def addPendingTasks(): Unit = {
     val (_, duration) = Utils.timeTakenMs {
-      val array = new ArrayBuffer[(String, Int)]() // Array(preferredLocation, task index)
+      val hostToIndices = new HashMap[String, ArrayBuffer[Int]]()
       for (i <- (0 until numTasks).reverse) {
-        addPendingTask(i, Some(array))
+        addPendingTask(i, Option(hostToIndices))
 
 Review comment:
   nit: more idiomatic to use `Some(hostToIndices)` here
   (`Option(foo)` is used to guard against `foo` being `null`, and convert it into `None`, but it can't be null here).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org