DBZ-212 Remove PostgreSQL getLogicalName function
This commit is contained in:
parent
b2529352cc
commit
38f3856c31
@ -575,6 +575,7 @@ public static SchemaRefreshMode parse(String value) {
|
||||
.withType(Type.STRING)
|
||||
.withWidth(Width.MEDIUM)
|
||||
.withImportance(Importance.HIGH)
|
||||
.withValidation(Field::isRequired)
|
||||
.withDescription("Unique name that identifies the database server and all recorded offsets, and"
|
||||
+ "that is used as a prefix for all schemas and topics. "
|
||||
+ "Each distinct Postgres installation should have a separate namespace and monitored by "
|
||||
@ -859,7 +860,7 @@ public static SchemaRefreshMode parse(String value) {
|
||||
protected PostgresConnectorConfig(Configuration config) {
|
||||
super(
|
||||
config,
|
||||
getLogicalName(config),
|
||||
config.getString(SERVER_NAME),
|
||||
null, // TODO whitelist handling implemented locally here for the time being
|
||||
null
|
||||
);
|
||||
@ -873,16 +874,6 @@ protected PostgresConnectorConfig(Configuration config) {
|
||||
this.schemaRefreshMode = SchemaRefreshMode.parse(config.getString(SCHEMA_REFRESH_MODE));
|
||||
}
|
||||
|
||||
private static String getLogicalName(Configuration config) {
|
||||
String logicalName = config.getString(PostgresConnectorConfig.SERVER_NAME);
|
||||
|
||||
if (logicalName == null) {
|
||||
logicalName = config.getString(HOSTNAME) + ":" + config.getInteger(PORT) + "/" + config.getString(DATABASE_NAME);
|
||||
}
|
||||
|
||||
return logicalName;
|
||||
}
|
||||
|
||||
protected String hostname() {
|
||||
return config.getString(HOSTNAME);
|
||||
}
|
||||
|
@ -126,13 +126,13 @@ public void shouldValidateConfiguration() throws Exception {
|
||||
assertConfigurationErrors(validatedConfig, PostgresConnectorConfig.HOSTNAME, 1);
|
||||
assertConfigurationErrors(validatedConfig, PostgresConnectorConfig.USER, 1);
|
||||
assertConfigurationErrors(validatedConfig, PostgresConnectorConfig.DATABASE_NAME, 1);
|
||||
assertConfigurationErrors(validatedConfig, PostgresConnectorConfig.SERVER_NAME, 1);
|
||||
|
||||
// validate the non required fields
|
||||
validateField(validatedConfig, PostgresConnectorConfig.PLUGIN_NAME, LogicalDecoder.DECODERBUFS.getValue());
|
||||
validateField(validatedConfig, PostgresConnectorConfig.SLOT_NAME, ReplicationConnection.Builder.DEFAULT_SLOT_NAME);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.DROP_SLOT_ON_STOP, Boolean.FALSE);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.PORT, PostgresConnectorConfig.DEFAULT_PORT);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.SERVER_NAME, null);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.TOPIC_SELECTION_STRATEGY, PostgresConnectorConfig.TopicSelectionStrategy.TOPIC_PER_TABLE);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.MAX_QUEUE_SIZE, PostgresConnectorConfig.DEFAULT_MAX_QUEUE_SIZE);
|
||||
validateField(validatedConfig, PostgresConnectorConfig.MAX_BATCH_SIZE, PostgresConnectorConfig.DEFAULT_MAX_BATCH_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user