Skip to content
Snippets Groups Projects
Commit 6e88583a authored by Mridul Muralidharan's avatar Mridul Muralidharan Committed by Matei Zaharia
Browse files

[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
parent 2d0150c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment