Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +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]]
= {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: now that there's space in L167, move = { up one line


val nodeToSplit = new HashMap[String, HashSet[SplitInfo]]
Expand All @@ -178,6 +178,6 @@ object InputFormatInfo {
}
}

nodeToSplit
nodeToSplit.map(entry => entry._1 -> entry._2.toSet).toMap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: How about nodeToSplit.mapValues(_.toSet).toMap? Looks simpler to me.

}
}