You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2014/04/06 00:23:41 UTC

git commit: [SPARK-1371] fix computePreferredLocations signature to not depend on underlying implementation

Repository: spark
Updated Branches:
  refs/heads/master 2d0150c1a -> 6e88583ae


[SPARK-1371] fix computePreferredLocations signature to not depend on underlying implementation

Change to Map and Set - not mutable HashMap and HashSet

Author: Mridul Muralidharan <mr...@apache.org>

Closes #302 from mridulm/master and squashes the following commits:

df747af [Mridul Muralidharan] Address review comments
17e2907 [Mridul Muralidharan] fix computePreferredLocations signature to not depend on underlying implementation


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6e88583a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6e88583a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6e88583a

Branch: refs/heads/master
Commit: 6e88583aef7d8caf59d53c9fcb659a62d2cd6051
Parents: 2d0150c
Author: Mridul Muralidharan <mr...@apache.org>
Authored: Sat Apr 5 15:23:37 2014 -0700
Committer: Matei Zaharia <ma...@databricks.com>
Committed: Sat Apr 5 15:23:37 2014 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/scheduler/InputFormatInfo.scala | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6e88583a/core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala b/core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala
index 5555585..b3f2cb3 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala
@@ -164,8 +164,7 @@ object InputFormatInfo {
 
     PS: I know the wording here is weird, hopefully it makes some sense !
   */
-  def computePreferredLocations(formats: Seq[InputFormatInfo]): HashMap[String, HashSet[SplitInfo]]
-  = {
+  def computePreferredLocations(formats: Seq[InputFormatInfo]): Map[String, Set[SplitInfo]] = {
 
     val nodeToSplit = new HashMap[String, HashSet[SplitInfo]]
     for (inputSplit <- formats) {
@@ -178,6 +177,6 @@ object InputFormatInfo {
       }
     }
 
-    nodeToSplit
+    nodeToSplit.mapValues(_.toSet).toMap
   }
 }