public static boolean needsCleaning(AcidDirectory dir, StorageDescriptor sd) {
    int numObsoleteDirs = dir.getObsolete().size() + dir.getAbortedDirectories().size();
    boolean needsJustCleaning = numObsoleteDirs > 0;
    if (needsJustCleaning) {
      LOG.info("{} obsolete directories in {} found; marked for cleaning.", numObsoleteDirs,
          sd.getLocation());
    }
    return needsJustCleaning;
  }
Check for obsolete directories, and return true if any exist and Cleaner should be
run. For example if we insert overwrite into a table with only deltas, a new base file with
the highest writeId is created so there will be no live delta directories, only obsolete
ones. Compaction is not needed, but the cleaner should still be run.

@return true if cleaning is needed
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/service/AcidCompactionService.java