public void compactStores() throws IOException {
    for (HStore s : stores.values()) {
      Optional<CompactionContext> compaction = s.requestCompaction();
      if (compaction.isPresent()) {
        compact(compaction.get(), s, NoLimitThroughputController.INSTANCE, null);
      }
    }
  }
This is a helper function that compact all the stores synchronously.
<p>
It is used by utilities and testing
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java