private static int countStoreFilesInFamilies(List<HRegion> regions, final byte[][] families) {
    int count = 0;
    for (HRegion region : regions) {
      count += region.getStoreFileList(families).size();
    }
    return count;
  }
Load data to a table, flush it to disk, trigger compaction, confirm the compaction state is
right and wait till it is done.
@param singleFamily otherwise, run compaction on all cfs
@param stateSource  get the state by Admin or Master
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java