viirya commented on a change in pull request #25856: [SPARK-29182][Core] Cache 
preferred locations of checkpointed RDD
URL: https://github.com/apache/spark/pull/25856#discussion_r327474537
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rdd/ReliableCheckpointRDD.scala
 ##########
 @@ -82,14 +83,28 @@ private[spark] class ReliableCheckpointRDD[T: ClassTag](
     Array.tabulate(inputFiles.length)(i => new CheckpointRDDPartition(i))
   }
 
+  // Cache of preferred locations of checkpointed files.
+  private[spark] val cachedPreferredLocations: mutable.HashMap[Int, 
Seq[String]] =
+    mutable.HashMap.empty
 
 Review comment:
   Ur, Spark not only chooses hosts from preferred locations. It is just a 
preferred list, Spark still can launch task if the list of hosts are 
unavailable.
   
   If a preferred location is present, the task will be added into pending task 
set for the host. But it is also added into a set of all tasks.
   
   
https://github.com/apache/spark/blob/b29829e2abdebdf6fa9dd0a4a4cf4c9d676ee82d/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala#L238-L251
   
   The task in the set of all tasks can still be dequeued and scheduled:
   
   
https://github.com/apache/spark/blob/b29829e2abdebdf6fa9dd0a4a4cf4c9d676ee82d/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala#L358-L362
   

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