private CleanupRequest getCleaningRequestBasedOnLocation(CompactionInfo ci, String location) {
    String strIfPurge = ci.getProperty("ifPurge");
    boolean ifPurge = strIfPurge != null || Boolean.parseBoolean(ci.getProperty("ifPurge"));

    Path obsoletePath = new Path(location);
    return new CleanupRequestBuilder()
            .setLocation(location).setDbName(ci.dbname).setFullPartitionName(ci.getFullPartitionName())
            .setRunAs(ci.runAs).setPurge(ifPurge).setObsoleteDirs(Collections.singletonList(obsoletePath))
            .build();
  }
A compaction based implementation of TaskHandler.
Provides implementation of creation of compaction clean tasks.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java