private boolean isEmptyDirDeletable(Path dir) {
    for (T cleaner : cleanersChain) {
      if (cleaner.isStopped() || this.getStopper().isStopped()) {
        LOG.warn("A file cleaner {} is stopped, won't delete the empty directory {}",
          this.getName(), dir);
        return false;
      }
      if (!cleaner.isEmptyDirDeletable(dir)) {
        // If one of the cleaner need the empty directory, skip delete it
        return false;
      }
    }
    return true;
  }
Check if a empty directory with no subdirs or subfiles can be deleted
@param dir Path of the directory
@return True if the directory can be deleted, otherwise false
hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java