private boolean needCompaction() {
    for (Store store : region.getStores()) {
      if (store.getStorefilesCount() >= compactMin) {
        return true;
      }
    }
    return false;
  }
As long as there is no RegionServerServices for a master local region, we need implement the
flush and compaction logic by our own.
<p/>
The flush logic is very simple, every time after calling a modification method in
{@link RegionProcedureStore}, we will call the {@link #onUpdate()} method below, and in this
method, we will check the memstore size and if it is above the flush size, we will call
{@link HRegion#flush(boolean)} to force flush all stores.
<p/>
And for compaction, the logic is also very simple. After flush, we will check the store file
count, if it is above the compactMin, we will do a major compaction.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegionFlusherAndCompactor.java