new Function<org.apache.hadoop.mapred.InputSplit, TaskLocationHint>() {
@Override
public TaskLocationHint apply(org.apache.hadoop.mapred.InputSplit input) {
try {
if (input.getLocations() != null) {
return new TaskLocationHint(new HashSet<String>(Arrays.asList(input.getLocations())),
null);
} else {
LOG.info("NULL Location: returning an empty location hint");
return new TaskLocationHint(null,null);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}