@Override
    protected void chore() {
      final StringBuilder whyFlush = new StringBuilder();
      for (HRegion r : this.server.onlineRegions.values()) {
        if (r == null) {
          continue;
        }
        if (r.shouldFlush(whyFlush)) {
          FlushRequester requester = server.getFlushRequester();
          if (requester != null) {
            long delay = ThreadLocalRandom.current().nextLong(rangeOfDelayMs) + MIN_DELAY_TIME;
            // Throttle the flushes by putting a delay. If we don't throttle, and there
            // is a balanced write-load on the regions in a table, we might end up
            // overwhelming the filesystem with too many flushes at once.
            if (requester.requestDelayedFlush(r, delay)) {
              LOG.info("{} requesting flush of {} because {} after random delay {} ms", getName(),
                r.getRegionInfo().getRegionNameAsString(), whyFlush.toString(), delay);
            }
          }
        }
      }
    }
Inner class that runs on a long period checking if regions need compaction.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java