@Override
  @RetrySemantics.SafeToRetry
  public CompactionInfo findNextToCompact(FindNextCompactRequest rqst) throws MetaException {
    if (rqst == null) {
      throw new MetaException("FindNextCompactRequest is null");
    }
    long poolTimeout = MetastoreConf.getTimeVar(conf, MetastoreConf.ConfVars.COMPACTOR_WORKER_POOL_TIMEOUT, TimeUnit.MILLISECONDS);
    return new NextCompactionFunction(rqst, getDbTime(), poolTimeout).execute(jdbcResource);
  }
This will grab the next compaction request off of the queue, and assign it to the worker.
@param rqst request to find next compaction to run
@return an info element for next compaction in the queue, or null if there is no work to do now.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java