spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sryza <...@git.apache.org>
Subject [GitHub] spark pull request: SPARK-1767: Prefer HDFS-cached replicas when s...
Date Tue, 02 Sep 2014 22:29:05 GMT
Github user sryza commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1486#discussion_r17020666
  
    --- 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
    +          } else if (ploc.priority < highestPriority) {
    +            l
    +          } else {
    +            (TaskLocation(ploc.host)) :: l
    +          }
    +      }
    +      if (highestPriority > PartitionPriority.NORMAL) {
    +        logTrace("Using prioritized location(s): " + taskLocations.map(_.host).mkString(",")
+
    +                 " which have priority " + highestPriority)
    --- End diff --
    
    Should be indented two spaces past logTrace.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message