public static Map<String, Map<String, Float>> getRegionDegreeLocalityMappingFromFS(
    final Configuration conf, final String desiredTable, int threadPoolSize) throws IOException {
    Map<String, Map<String, Float>> regionDegreeLocalityMapping = new ConcurrentHashMap<>();
    getRegionLocalityMappingFromFS(conf, desiredTable, threadPoolSize, regionDegreeLocalityMapping);
    return regionDegreeLocalityMapping;
  }
This function is to scan the root path of the file system to get the degree of locality for
each region on each of the servers having at least one block of that region. the configuration
to use the table you wish to scan locality for the thread pool size to use
@return the mapping from region encoded name to a map of server names to locality fraction in
        case of file system errors or interrupts
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java