public static boolean isSourceOfReplication(Database db) {
    assert (db != null);
    String replPolicyIds = getReplPolicyIdString(db);
    return  !StringUtils.isEmpty(replPolicyIds);
  }
Thread to clear old files of cmroot recursively
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java