public static boolean shouldEnableCm(Database db, Table table) {
    assert (table != null);
    return isSourceOfReplication(db) && !MetaStoreUtils.isExternalTable(table);
  }
Thread to clear old files of cmroot recursively
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java