DBZ-1067 Add column blacklist field to RelationalDatabaseConnectorConfig

This commit is contained in:
Grzegorz Kołakowski 2019-01-09 17:37:30 +01:00 committed by Gunnar Morling
parent 631729b99e
commit 91c72738c0
3 changed files with 17 additions and 27 deletions

View File

@ -685,18 +685,6 @@ public static DdlParsingMode parse(String value, String defaultValue) {
.withValidation(Field::isListOfRegex, MySqlConnectorConfig::validateTableBlacklist) .withValidation(Field::isListOfRegex, MySqlConnectorConfig::validateTableBlacklist)
.withInvisibleRecommender(); .withInvisibleRecommender();
/**
* A comma-separated list of regular expressions that match fully-qualified names of columns to be excluded from monitoring
* and change messages. Fully-qualified names for columns are of the form {@code <databaseName>.<tableName>.<columnName>}
* or {@code <databaseName>.<schemaName>.<tableName>.<columnName>}.
*/
public static final Field COLUMN_BLACKLIST = Field.create("column.blacklist")
.withDisplayName("Exclude Columns")
.withType(Type.STRING)
.withWidth(Width.LONG)
.withImportance(Importance.MEDIUM)
.withDescription("");
/** /**
* A comma-separated list of regular expressions that match source UUIDs in the GTID set used to find the binlog * A comma-separated list of regular expressions that match source UUIDs in the GTID set used to find the binlog
* position in the MySQL server. Only the GTID ranges that have sources matching one of these include patterns will * position in the MySQL server. Only the GTID ranges that have sources matching one of these include patterns will
@ -999,7 +987,7 @@ public static final Field MASK_COLUMN(int length) {
GTID_SOURCE_INCLUDES, GTID_SOURCE_EXCLUDES, GTID_SOURCE_INCLUDES, GTID_SOURCE_EXCLUDES,
GTID_SOURCE_FILTER_DML_EVENTS, GTID_SOURCE_FILTER_DML_EVENTS,
GTID_NEW_CHANNEL_POSITION, GTID_NEW_CHANNEL_POSITION,
TIME_PRECISION_MODE, RelationalDatabaseConnectorConfig.DECIMAL_HANDLING_MODE, TIME_PRECISION_MODE, DECIMAL_HANDLING_MODE,
SSL_MODE, SSL_KEYSTORE, SSL_KEYSTORE_PASSWORD, SSL_MODE, SSL_KEYSTORE, SSL_KEYSTORE_PASSWORD,
SSL_TRUSTSTORE, SSL_TRUSTSTORE_PASSWORD, JDBC_DRIVER, SSL_TRUSTSTORE, SSL_TRUSTSTORE_PASSWORD, JDBC_DRIVER,
BIGINT_UNSIGNED_HANDLING_MODE, BIGINT_UNSIGNED_HANDLING_MODE,
@ -1083,7 +1071,7 @@ protected static ConfigDef configDef() {
CommonConnectorConfig.TOMBSTONES_ON_DELETE); CommonConnectorConfig.TOMBSTONES_ON_DELETE);
Field.group(config, "Connector", CONNECTION_TIMEOUT_MS, KEEP_ALIVE, KEEP_ALIVE_INTERVAL_MS, CommonConnectorConfig.MAX_QUEUE_SIZE, Field.group(config, "Connector", CONNECTION_TIMEOUT_MS, KEEP_ALIVE, KEEP_ALIVE_INTERVAL_MS, CommonConnectorConfig.MAX_QUEUE_SIZE,
CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.POLL_INTERVAL_MS, CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.POLL_INTERVAL_MS,
SNAPSHOT_MODE, SNAPSHOT_LOCKING_MODE, SNAPSHOT_MINIMAL_LOCKING, TIME_PRECISION_MODE, RelationalDatabaseConnectorConfig.DECIMAL_HANDLING_MODE, SNAPSHOT_MODE, SNAPSHOT_LOCKING_MODE, SNAPSHOT_MINIMAL_LOCKING, TIME_PRECISION_MODE, DECIMAL_HANDLING_MODE,
BIGINT_UNSIGNED_HANDLING_MODE, SNAPSHOT_DELAY_MS, DDL_PARSER_MODE); BIGINT_UNSIGNED_HANDLING_MODE, SNAPSHOT_DELAY_MS, DDL_PARSER_MODE);
return config; return config;
} }

View File

@ -639,17 +639,6 @@ public static SchemaRefreshMode parse(String value) {
.withValidation(Field::isListOfRegex, PostgresConnectorConfig::validateTableBlacklist) .withValidation(Field::isListOfRegex, PostgresConnectorConfig::validateTableBlacklist)
.withInvisibleRecommender(); .withInvisibleRecommender();
/**
* A comma-separated list of regular expressions that match fully-qualified names of columns to be excluded from monitoring
* and change messages. Fully-qualified names for columns are of the form {@code <schemaName>.<tableName>.<columnName>}.
*/
public static final Field COLUMN_BLACKLIST = Field.create("column.blacklist")
.withDisplayName("Exclude Columns")
.withType(Type.STRING)
.withWidth(Width.LONG)
.withImportance(Importance.MEDIUM)
.withDescription("");
//TODO author=Horia Chiorean date=25/10/2016 description=PG 9.x logical decoding does not support schema changes //TODO author=Horia Chiorean date=25/10/2016 description=PG 9.x logical decoding does not support schema changes
public static final Field INCLUDE_SCHEMA_CHANGES = Field.create("include.schema.changes") public static final Field INCLUDE_SCHEMA_CHANGES = Field.create("include.schema.changes")
.withDisplayName("Include database schema changes") .withDisplayName("Include database schema changes")
@ -766,7 +755,7 @@ public static SchemaRefreshMode parse(String value) {
SCHEMA_WHITELIST, SCHEMA_WHITELIST,
SCHEMA_BLACKLIST, TABLE_WHITELIST, TABLE_BLACKLIST, SCHEMA_BLACKLIST, TABLE_WHITELIST, TABLE_BLACKLIST,
COLUMN_BLACKLIST, SNAPSHOT_MODE, COLUMN_BLACKLIST, SNAPSHOT_MODE,
TIME_PRECISION_MODE, RelationalDatabaseConnectorConfig.DECIMAL_HANDLING_MODE,HSTORE_HANDLING_MODE, TIME_PRECISION_MODE, DECIMAL_HANDLING_MODE,HSTORE_HANDLING_MODE,
SSL_MODE, SSL_CLIENT_CERT, SSL_CLIENT_KEY_PASSWORD, SSL_MODE, SSL_CLIENT_CERT, SSL_CLIENT_KEY_PASSWORD,
SSL_ROOT_CERT, SSL_CLIENT_KEY, SNAPSHOT_LOCK_TIMEOUT_MS, ROWS_FETCH_SIZE, SSL_SOCKET_FACTORY, SSL_ROOT_CERT, SSL_CLIENT_KEY, SNAPSHOT_LOCK_TIMEOUT_MS, ROWS_FETCH_SIZE, SSL_SOCKET_FACTORY,
STATUS_UPDATE_INTERVAL_MS, TCP_KEEPALIVE, INCLUDE_UNKNOWN_DATATYPES, STATUS_UPDATE_INTERVAL_MS, TCP_KEEPALIVE, INCLUDE_UNKNOWN_DATATYPES,
@ -924,7 +913,7 @@ protected static ConfigDef configDef() {
Heartbeat.HEARTBEAT_TOPICS_PREFIX); Heartbeat.HEARTBEAT_TOPICS_PREFIX);
Field.group(config, "Connector", TOPIC_SELECTION_STRATEGY, CommonConnectorConfig.POLL_INTERVAL_MS, CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.MAX_QUEUE_SIZE, Field.group(config, "Connector", TOPIC_SELECTION_STRATEGY, CommonConnectorConfig.POLL_INTERVAL_MS, CommonConnectorConfig.MAX_BATCH_SIZE, CommonConnectorConfig.MAX_QUEUE_SIZE,
CommonConnectorConfig.SNAPSHOT_DELAY_MS, CommonConnectorConfig.SNAPSHOT_DELAY_MS,
SNAPSHOT_MODE, SNAPSHOT_LOCK_TIMEOUT_MS, TIME_PRECISION_MODE, RelationalDatabaseConnectorConfig.DECIMAL_HANDLING_MODE, HSTORE_HANDLING_MODE,SCHEMA_REFRESH_MODE,ROWS_FETCH_SIZE); SNAPSHOT_MODE, SNAPSHOT_LOCK_TIMEOUT_MS, TIME_PRECISION_MODE, DECIMAL_HANDLING_MODE, HSTORE_HANDLING_MODE,SCHEMA_REFRESH_MODE,ROWS_FETCH_SIZE);
return config; return config;
} }

View File

@ -137,6 +137,19 @@ public static DecimalHandlingMode parse(String value, String defaultValue) {
.withValidation(Field::isBoolean) .withValidation(Field::isBoolean)
.withDescription("Flag specifying whether built-in tables should be ignored."); .withDescription("Flag specifying whether built-in tables should be ignored.");
/**
* A comma-separated list of regular expressions that match fully-qualified names of columns to be excluded from monitoring
* and change messages. The exact form of fully qualified names for columns might vary between connector types.
* For instance, they could be of the form {@code <databaseName>.<tableName>.<columnName>} or
* {@code <schemaName>.<tableName>.<columnName>} or {@code <databaseName>.<schemaName>.<tableName>.<columnName>}.
*/
public static final Field COLUMN_BLACKLIST = Field.create("column.blacklist")
.withDisplayName("Exclude Columns")
.withType(Type.STRING)
.withWidth(Width.LONG)
.withImportance(Importance.MEDIUM)
.withDescription("");
public static final Field DECIMAL_HANDLING_MODE = Field.create("decimal.handling.mode") public static final Field DECIMAL_HANDLING_MODE = Field.create("decimal.handling.mode")
.withDisplayName("Decimal Handling") .withDisplayName("Decimal Handling")
.withEnum(DecimalHandlingMode.class, DecimalHandlingMode.PRECISE) .withEnum(DecimalHandlingMode.class, DecimalHandlingMode.PRECISE)