diff options
author | Mridul Muralidharan <mridulm80@apache.org> | 2014-04-05 15:23:37 -0700 |
---|---|---|
committer | Matei Zaharia <matei@databricks.com> | 2014-04-05 15:23:37 -0700 |
commit | 6e88583aef7d8caf59d53c9fcb659a62d2cd6051 (patch) | |
tree | 00cd6486a38755dfd20e054ea5f00eb17c64cff4 /core | |
parent | 2d0150c1a2688296346fa279b1f8d14edac935eb (diff) | |
download | spark-6e88583aef7d8caf59d53c9fcb659a62d2cd6051.tar.gz spark-6e88583aef7d8caf59d53c9fcb659a62d2cd6051.tar.bz2 spark-6e88583aef7d8caf59d53c9fcb659a62d2cd6051.zip |
[SPARK-1371] fix computePreferredLocations signature to not depend on underlying implementation
Change to Map and Set - not mutable HashMap and HashSet
Author: Mridul Muralidharan <mridulm80@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
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala | 5 |
1 files changed, 2 insertions, 3 deletions
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 5555585c8b..b3f2cb346f 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 } } |