@Override
  public void chore() {
    // Noop if rss is null. This will never happen in a normal condition except for cases
    // when the test case is not spinning up a cluster
    if (regionServerServices == null) return;
    List<HRegion> onlineRegions = (List<HRegion>) regionServerServices.getRegions();
    if (onlineRegions == null) return;
    for (HRegion region : onlineRegions) {
      if (LOG.isTraceEnabled()) {
        LOG.trace("Started compacted hfiles cleaner on " + region.getRegionInfo());
      }
      for (HStore store : region.getStores()) {
        try {
          if (useExecutor && regionServerServices != null) {
            CompactedHFilesDischargeHandler handler = new CompactedHFilesDischargeHandler(
              (Server) regionServerServices, EventType.RS_COMPACTED_FILES_DISCHARGER, store);
            regionServerServices.getExecutorService().submit(handler);
          } else {
            // call synchronously if the RegionServerServices are not
            // available
            store.closeAndArchiveCompactedFiles();
          }
          if (LOG.isTraceEnabled()) {
            LOG.trace("Completed archiving the compacted files for the region "
              + region.getRegionInfo() + " under the store " + store.getColumnFamilyName());
          }
        } catch (Exception e) {
          LOG.error("Exception while trying to close and archive the compacted store "
            + "files of the store  " + store.getColumnFamilyName() + " in the" + " region "
            + region.getRegionInfo(), e);
        }
      }
      if (LOG.isTraceEnabled()) {
        LOG
          .trace("Completed the compacted hfiles cleaner for the region " + region.getRegionInfo());
      }
    }
  }
CompactedHFilesDischarger runs asynchronously by default using the hosting RegionServer's
Executor. In tests it can be useful to force a synchronous cleanup. Use this method to set
no-executor before you call run.
@return The old setting for <code>useExecutor</code>
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactedHFilesDischarger.java