@Override boolean replIsCompactionDisabledForDatabase(String dbName) throws TException {
    try {
      Database database = msc.getDatabase(getDefaultCatalog(conf), dbName);
      // Compaction is disabled until after first successful incremental load. Check HIVE-21197 for more detail.
      return ReplUtils.isFirstIncPending(database.getParameters());
    } catch (NoSuchObjectException e) {
      LOG.info("Unable to find database " + dbName);
      return true;
    }
  }
Compactor thread that can run outside the metastore. It will
use the metastore thrift API which will default to a remote connection
if the thread is running outside the metastore or to a function call
if it's running within the metastore.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/RemoteCompactorThread.java