private void cleanUsingLocation(CompactionInfo ci, String path, boolean requiresLock) throws MetaException {
    List<Path> deleted;
    if (requiresLock) {
      LockRequest lockRequest = createLockRequest(ci);
      LockResponse res = null;
      try {
        res = txnHandler.lock(lockRequest);
        deleted = fsRemover.clean(getCleaningRequestBasedOnLocation(ci, path));
      } catch (NoSuchTxnException | TxnAbortedException e) {
        LOG.error("Error while trying to acquire exclusive write lock: {}", e.getMessage());
        throw new MetaException(e.getMessage());
      } finally {
        if (res != null) {
          try {
            txnHandler.unlock(new UnlockRequest(res.getLockid()));
          } catch (NoSuchLockException | TxnOpenException e) {
            LOG.error("Error while trying to release exclusive write lock: {}", e.getMessage());
          }
        }
      }
    } else {
      deleted = fsRemover.clean(getCleaningRequestBasedOnLocation(ci, path));
    }
    if (!deleted.isEmpty()) {
      txnHandler.markCleaned(ci);
    } else {
      txnHandler.clearCleanerStart(ci);
    }
  }
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