public static Character thriftCompactionType2DbType(CompactionType ct) throws MetaException {
    switch (ct) {
      case MAJOR:
        return TxnStore.MAJOR_TYPE;
      case MINOR:
        return TxnStore.MINOR_TYPE;
      case REBALANCE:
        return TxnStore.REBALANCE_TYPE;
      case ABORT_TXN_CLEANUP:
        return TxnStore.ABORT_TXN_CLEANUP_TYPE;
      case SMART_OPTIMIZE:
        return TxnStore.SMART_OPTIMIZE_TYPE;
      default:
        throw new MetaException("Unexpected compaction type " + ct);
    }
  }
Determine which user to run an operation as. If metastore.compactor.run.as.user is set, that user will be
returned; if not: the the owner of the directory to be compacted.
It is asserted that either the user running the hive metastore or the table
owner must be able to stat the directory and determine the owner.
@param location directory that will be read or written to.
@param t metastore table object
@return metastore.compactor.run.as.user value; or if that is not set: username of the owner of the location.
@throws java.io.IOException if neither the hive metastore user nor the table owner can stat
the location.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java