@Override
  public String[] getLocations(InputSplit split) throws IOException {
    if (!(split instanceof FileSplit)) {
      LOG.debug("Split: {} is not a FileSplit. Using default locations", split);
      return split.getLocations();
    }
    FileSplit fsplit = (FileSplit) split;
    String location = locations.get(determineLocation(locations, fsplit));
    return (location != null) ? new String[] { location } : null;
  }
This maps a split (path + offset) to an index based on the number of locations provided.

If locations do not change across jobs, the intention is to map the same split to the same node.

A big problem is when nodes change (added, removed, temporarily removed and re-added) etc. That changes
the number of locations / position of locations - and will cause the cache to be almost completely invalidated.

TODO: Support for consistent hashing when combining the split location generator and the ServiceRegistry.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HostAffinitySplitLocationProvider.java