Skip to content

Commit

Permalink
[SPARK-1371] fix computePreferredLocations signature to not depend on…
Browse files Browse the repository at this point in the history
… underlying implementation

Change to Map and Set - not mutable HashMap and HashSet

Author: Mridul Muralidharan <[email protected]>

Closes apache#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
  • Loading branch information
Mridul Muralidharan authored and pdeyhim committed Jun 25, 2014
1 parent 7af0bc4 commit 161e79a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -178,6 +177,6 @@ object InputFormatInfo {
}
}

nodeToSplit
nodeToSplit.mapValues(_.toSet).toMap
}
}

0 comments on commit 161e79a

Please sign in to comment.