public static int getRegionReferenceAndLinkFileCount(final FileSystem fs, final Path p) {
    int result = 0;
    try {
      for (Path familyDir : getFamilyDirs(fs, p)) {
        result += getReferenceAndLinkFilePaths(fs, familyDir).size();
      }
    } catch (IOException e) {
      LOG.warn("Error Counting reference files.", e);
    }
    return result;
  }
Given a particular region dir, return all the familydirs inside it
@param fs        A file system for the Path
@param regionDir Path to a specific region directory
@return List of paths to valid family directories in region dir.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java