public static Map<String, Integer> getTableFragmentation(final HMaster master)
    throws IOException {
    Path path = CommonFSUtils.getRootDir(master.getConfiguration());
    // since HMaster.getFileSystem() is package private
    FileSystem fs = path.getFileSystem(master.getConfiguration());
    return getTableFragmentation(fs, path);
  }
Runs through the HBase rootdir and checks how many stores for each table have more than one
file in them. Checks -ROOT- and hbase:meta too. The total percentage across all tables is
stored under the special key "-TOTAL-".
@param master The master defining the HBase root and file system.
@return A map for each table and its percentage (never null).
@throws IOException When scanning the directory fails.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java