Skip to content
Merged
Changes from all commits
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 @@ -74,9 +74,13 @@ public long getLength() {

@Override
public String[] getLocations() {
if (locations == null) {
// The implementation of getLocations() is only meant to be used during split computation
// getLocations() won't be accurate when called on worker nodes and will always return "*"
if (locations == null && conf != null) {

@rdsr rdsr Oct 11, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think a comment can help here saying implementation of getLocations is only meant to be used during splits computation. getLocations won't be accurate when called on worker nodes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

boolean localityPreferred = conf.getBoolean(InputFormatConfig.LOCALITY, false);
locations = localityPreferred ? Util.blockLocations(task, conf) : ANYWHERE;
} else {
locations = ANYWHERE;
}

return locations;
Expand Down