public int getReplicationFactor(String database, TConsensusGroupType consensusGroupType)
      throws DatabaseNotExistsException {
    TDatabaseSchema databaseSchema = getDatabaseSchemaByName(database);
    return TConsensusGroupType.SchemaRegion.equals(consensusGroupType)
        ? databaseSchema.getSchemaReplicationFactor()
        : databaseSchema.getDataReplicationFactor();
  }
Only leader use this interface. Get the replication factor of specified Database

@param database DatabaseName
@param consensusGroupType SchemaRegion or DataRegion
@return SchemaReplicationFactor or DataReplicationFactor
@throws DatabaseNotExistsException When the specific Database doesn't exist
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java