DBZ-5045 Remove deprecated SCHEMA_WHITELIST
This commit is contained in:
parent
6abbcee6a3
commit
261188482f
@ -952,7 +952,6 @@ public static GtidNewChannelPosition parse(String value, String defaultValue) {
|
||||
private static final ConfigDefinition CONFIG_DEFINITION = HistorizedRelationalDatabaseConnectorConfig.CONFIG_DEFINITION.edit()
|
||||
.name("MySQL")
|
||||
.excluding(
|
||||
SCHEMA_WHITELIST,
|
||||
SCHEMA_INCLUDE_LIST,
|
||||
SCHEMA_BLACKLIST,
|
||||
SCHEMA_EXCLUDE_LIST,
|
||||
|
@ -482,7 +482,6 @@ public class OracleConnectorConfig extends HistorizedRelationalDatabaseConnector
|
||||
private static final ConfigDefinition CONFIG_DEFINITION = HistorizedRelationalDatabaseConnectorConfig.CONFIG_DEFINITION.edit()
|
||||
.name("Oracle")
|
||||
.excluding(
|
||||
SCHEMA_WHITELIST,
|
||||
SCHEMA_INCLUDE_LIST,
|
||||
SCHEMA_BLACKLIST,
|
||||
SCHEMA_EXCLUDE_LIST,
|
||||
|
@ -229,7 +229,6 @@ public void shouldValidateConfiguration() throws Exception {
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SSL_CLIENT_KEY, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SSL_CLIENT_KEY_PASSWORD, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SSL_ROOT_CERT, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SCHEMA_WHITELIST, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SCHEMA_INCLUDE_LIST, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SCHEMA_BLACKLIST, null);
|
||||
validateConfigField(validatedConfig, PostgresConnectorConfig.SCHEMA_EXCLUDE_LIST, null);
|
||||
@ -403,7 +402,7 @@ public void shouldConsumeMessagesFromSnapshotOld() throws Exception {
|
||||
.with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.INITIAL.getValue())
|
||||
.with(PostgresConnectorConfig.MAX_QUEUE_SIZE, recordCount / 2)
|
||||
.with(PostgresConnectorConfig.MAX_BATCH_SIZE, 10)
|
||||
.with(PostgresConnectorConfig.SCHEMA_WHITELIST, "s1");
|
||||
.with(PostgresConnectorConfig.SCHEMA_INCLUDE_LIST, "s1");
|
||||
start(PostgresConnector.class, configBuilder.build());
|
||||
assertConnectorIsRunning();
|
||||
|
||||
@ -1208,7 +1207,7 @@ public void shouldRemoveWhiteSpaceCharsOld() throws Exception {
|
||||
Configuration.Builder configBuilder = TestHelper.defaultConfig()
|
||||
.with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.INITIAL.getValue())
|
||||
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, Boolean.TRUE)
|
||||
.with(PostgresConnectorConfig.SCHEMA_WHITELIST, "s1")
|
||||
.with(PostgresConnectorConfig.SCHEMA_INCLUDE_LIST, "s1")
|
||||
.with(PostgresConnectorConfig.TABLE_INCLUDE_LIST, tableWhitelistWithWhitespace);
|
||||
|
||||
start(PostgresConnector.class, configBuilder.build());
|
||||
|
@ -67,7 +67,7 @@ public void shouldProcessFromSnapshotOld() throws Exception {
|
||||
|
||||
start(PostgresConnector.class, TestHelper.defaultConfig()
|
||||
.with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.INITIAL_ONLY)
|
||||
.with(PostgresConnectorConfig.SCHEMA_WHITELIST, "nopk")
|
||||
.with(PostgresConnectorConfig.SCHEMA_INCLUDE_LIST, "nopk")
|
||||
.build());
|
||||
assertConnectorIsRunning();
|
||||
|
||||
@ -126,7 +126,7 @@ public void shouldProcessFromStreaming() throws Exception {
|
||||
public void shouldProcessFromStreamingOld() throws Exception {
|
||||
start(PostgresConnector.class, TestHelper.defaultConfig()
|
||||
.with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NEVER)
|
||||
.with(PostgresConnectorConfig.SCHEMA_WHITELIST, "nopk")
|
||||
.with(PostgresConnectorConfig.SCHEMA_INCLUDE_LIST, "nopk")
|
||||
.build());
|
||||
assertConnectorIsRunning();
|
||||
waitForStreamingToStart();
|
||||
|
@ -361,7 +361,6 @@ public static SnapshotIsolationMode parse(String value, String defaultValue) {
|
||||
INCREMENTAL_SNAPSHOT_CHUNK_SIZE,
|
||||
INCREMENTAL_SNAPSHOT_ALLOW_SCHEMA_CHANGES)
|
||||
.excluding(
|
||||
SCHEMA_WHITELIST,
|
||||
SCHEMA_INCLUDE_LIST,
|
||||
SCHEMA_BLACKLIST,
|
||||
SCHEMA_EXCLUDE_LIST)
|
||||
|
@ -65,7 +65,6 @@ public abstract class RelationalDatabaseConnectorConfig extends CommonConnectorC
|
||||
public static final String COLUMN_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG = "\"column.include.list\" is already specified";
|
||||
public static final String COLUMN_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG = "\"column.whitelist\" is already specified";
|
||||
public static final String SCHEMA_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG = "\"schema.include.list\" is already specified";
|
||||
public static final String SCHEMA_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG = "\"schema.whitelist\" is already specified";
|
||||
public static final String DATABASE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG = "\"database.include.list\" is already specified";
|
||||
public static final String DATABASE_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG = "\"database.whitelist\" is already specified";
|
||||
|
||||
@ -358,20 +357,6 @@ public static DecimalHandlingMode parse(String value, String defaultValue) {
|
||||
.withDependents(TABLE_INCLUDE_LIST_NAME)
|
||||
.withDescription("The schemas for which events should be captured");
|
||||
|
||||
/**
|
||||
* Old, backwards-compatible "whitelist" property.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final Field SCHEMA_WHITELIST = Field.create("schema.whitelist")
|
||||
.withDisplayName("Deprecated: Include Schemas")
|
||||
.withType(Type.LIST)
|
||||
.withWidth(Width.LONG)
|
||||
.withImportance(Importance.LOW)
|
||||
.withValidation(Field::isListOfRegex)
|
||||
.withDependents(TABLE_INCLUDE_LIST_NAME)
|
||||
.withInvisibleRecommender()
|
||||
.withDescription("The schemas for which events should be captured (deprecated, use \"" + SCHEMA_INCLUDE_LIST.name() + "\" instead)");
|
||||
|
||||
/**
|
||||
* A comma-separated list of regular expressions that match schema names to be excluded from monitoring.
|
||||
* Must not be used with {@link #SCHEMA_INCLUDE_LIST}.
|
||||
@ -572,7 +557,6 @@ public static DecimalHandlingMode parse(String value, String defaultValue) {
|
||||
TABLE_INCLUDE_LIST,
|
||||
TABLE_EXCLUDE_LIST,
|
||||
TABLE_IGNORE_BUILTIN,
|
||||
SCHEMA_WHITELIST,
|
||||
SCHEMA_INCLUDE_LIST,
|
||||
SCHEMA_BLACKLIST,
|
||||
SCHEMA_EXCLUDE_LIST,
|
||||
@ -684,7 +668,7 @@ public String schemaExcludeList() {
|
||||
}
|
||||
|
||||
public String schemaIncludeList() {
|
||||
return getConfig().getFallbackStringProperty(SCHEMA_INCLUDE_LIST, SCHEMA_WHITELIST);
|
||||
return getConfig().getString(SCHEMA_INCLUDE_LIST);
|
||||
}
|
||||
|
||||
public String tableExcludeList() {
|
||||
@ -799,11 +783,11 @@ public Heartbeat createHeartbeat(TopicSelector<? extends DataCollectionId> topic
|
||||
}
|
||||
|
||||
private static int validateSchemaBlacklist(Configuration config, Field field, Field.ValidationOutput problems) {
|
||||
String whitelist = config.getFallbackStringPropertyWithWarning(SCHEMA_INCLUDE_LIST, SCHEMA_WHITELIST);
|
||||
String includeList = config.getString(SCHEMA_INCLUDE_LIST);
|
||||
String blacklist = config.getFallbackStringPropertyWithWarning(SCHEMA_EXCLUDE_LIST, SCHEMA_BLACKLIST);
|
||||
|
||||
if (whitelist != null && blacklist != null) {
|
||||
problems.accept(SCHEMA_BLACKLIST, blacklist, SCHEMA_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG);
|
||||
if (includeList != null && blacklist != null) {
|
||||
problems.accept(SCHEMA_BLACKLIST, blacklist, SCHEMA_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -44,10 +44,7 @@ public RelationalTableFilters(Configuration config, TableFilter systemTablesFilt
|
||||
config.getFallbackStringProperty(
|
||||
RelationalDatabaseConnectorConfig.DATABASE_EXCLUDE_LIST,
|
||||
RelationalDatabaseConnectorConfig.DATABASE_BLACKLIST))
|
||||
.includeSchemas(
|
||||
config.getFallbackStringProperty(
|
||||
RelationalDatabaseConnectorConfig.SCHEMA_INCLUDE_LIST,
|
||||
RelationalDatabaseConnectorConfig.SCHEMA_WHITELIST))
|
||||
.includeSchemas(config.getString(RelationalDatabaseConnectorConfig.SCHEMA_INCLUDE_LIST))
|
||||
.excludeSchemas(
|
||||
config.getFallbackStringProperty(
|
||||
RelationalDatabaseConnectorConfig.SCHEMA_EXCLUDE_LIST,
|
||||
|
Loading…
Reference in New Issue
Block a user