@Override
      public boolean accept(Path path) {
        // this is the region name; it may get some noise data
        if (null == path) {
          return false;
        }

        // no parent?
        Path parent = path.getParent();
        if (null == parent) {
          return false;
        }

        String regionName = path.getName();
        if (null == regionName) {
          return false;
        }

        if (!regionName.toLowerCase(Locale.ROOT).matches("[0-9a-f]+")) {
          return false;
        }
        return true;
      }
This function is to scan the root path of the file system to get either the mapping between the
region name and its best locality region server or the degree of locality of each region on
each of the servers having at least one block of that region. The output map parameters are
both optional. the configuration to use the table you wish to scan locality for the thread pool
size to use the map into which to put the locality degree mapping or null, must be a
thread-safe implementation in case of file system errors or interrupts
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java