Github user sryza commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1486#discussion_r17020639
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala 
---
    @@ -1296,7 +1298,25 @@ class DAGScheduler(
         // If the RDD has some placement preferences (as is the case for input 
RDDs), get those
         val rddPrefs = rdd.preferredLocations(rdd.partitions(partition)).toList
         if (!rddPrefs.isEmpty) {
    -      return rddPrefs.map(host => TaskLocation(host))
    +      // Use the highest priority locations that we have.
    +      var highestPriority = PartitionPriority.NORMAL
    +      val taskLocations = rddPrefs.foldLeft(List[TaskLocation]()) {
    +        (l, plocStr) =>
    +          val ploc = PartitionLocation.fromString(plocStr)
    +          if (ploc.priority > highestPriority) {
    +            highestPriority = ploc.priority
    +            (TaskLocation(ploc.host)) :: Nil
    --- End diff --
    
    Are the parentheses around TaskLocation necessary?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to