private void compactTable(final Path tableDir, final boolean compactOnce, final boolean major)
      throws IOException {
      TableDescriptor htd = FSTableDescriptors.getTableDescriptorFromFs(fs, tableDir);
      for (Path regionDir : FSUtils.getRegionDirs(fs, tableDir)) {
        compactRegion(tableDir, htd, regionDir, compactOnce, major);
      }
    }
Execute the compaction on the specified path.
@param path        Directory path on which to run compaction.
@param compactOnce Execute just a single step of compaction.
@param major       Request major compaction.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java