Package io.debezium.connector.binlog
Class BinlogConnectorConfig
java.lang.Object
io.debezium.config.CommonConnectorConfig
io.debezium.relational.RelationalDatabaseConnectorConfig
io.debezium.relational.HistorizedRelationalDatabaseConnectorConfig
io.debezium.connector.binlog.BinlogConnectorConfig
Configuration properties for binlog-based connectors.
- Author:
- Chris Cranford
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSet of predefined BigIntUnsignedHandlingMode options or aliases.static enumThe set of predefined SecureConnectionMode options or aliases.static interfaceA common strategy across binlog-based connectors to express snapshot locking requirements.static enumSet of predefined SnapshotMode options or aliases.Nested classes/interfaces inherited from class io.debezium.relational.RelationalDatabaseConnectorConfig
RelationalDatabaseConnectorConfig.DecimalHandlingMode, RelationalDatabaseConnectorConfig.SnapshotTablesRowCountOrderNested classes/interfaces inherited from class io.debezium.config.CommonConnectorConfig
CommonConnectorConfig.BinaryHandlingMode, CommonConnectorConfig.EventConvertingFailureHandlingMode, CommonConnectorConfig.EventProcessingFailureHandlingMode, CommonConnectorConfig.FieldNameAdjustmentMode, CommonConnectorConfig.SchemaNameAdjustmentMode, CommonConnectorConfig.SnapshotQueryMode, CommonConnectorConfig.Version, CommonConnectorConfig.WatermarkStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Fieldprivate final BinlogConnectorConfig.BigIntUnsignedHandlingModestatic final FieldSet of all built-in database names that will generally be ignored by the connector.private final Configurationprotected static final ConfigDefinitionstatic final Fieldprivate final Durationprivate static final intThe default size of the binlog buffer used for examining transactions and deciding whether to propagate them or not.private static final intThe default port for the binlog-based database.static final Fieldstatic final FieldDeprecated.static final FieldSpecifies the GTID ranges to be excluded.static final FieldWhen set totrue, the connector will produce DML events for transactions that were written by the binlog-based database servers based on the matching GTID filters that were included in the connector configuration inGTID_SOURCE_INCLUDESandGTID_SOURCE_EXCLUDES, if specified.static final FieldSpecifies the GTID ranges to be included.static final Fieldstatic final Fieldprivate final CommonConnectorConfig.EventProcessingFailureHandlingModestatic final Fieldstatic final Fieldprivate static final org.slf4j.Loggerstatic final Fieldstatic final Fieldstatic final Fieldprivate final booleanstatic final Fieldprivate final BinlogConnectorConfig.SecureConnectionModestatic final Fieldstatic final Fieldstatic final Fieldprivate final BinlogConnectorConfig.SnapshotModestatic final Fieldstatic final Fieldstatic final Fieldstatic final Fieldstatic final Fieldstatic final Fieldstatic final Fieldprivate final TemporalPrecisionMode(package private) static final StringIt is not possible to test disabled global locking locally as binlog-based connectors builds always provide global locking.static final Fieldstatic final FieldFields inherited from class io.debezium.relational.HistorizedRelationalDatabaseConnectorConfig
DEFAULT_SNAPSHOT_FETCH_SIZE, SCHEMA_HISTORY, SKIP_UNPARSEABLE_DDL_STATEMENTS, skipUnparseableDDL, STORE_ONLY_CAPTURED_TABLES_DDL, storeOnlyCapturedDatabasesDdl, storeOnlyCapturedTablesDdlFields inherited from class io.debezium.relational.RelationalDatabaseConnectorConfig
COLUMN_EXCLUDE_LIST, COLUMN_INCLUDE_LIST, COLUMN_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG, DATABASE_EXCLUDE_LIST, DATABASE_EXCLUDE_LIST_NAME, DATABASE_INCLUDE_LIST, DATABASE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG, DATABASE_INCLUDE_LIST_NAME, DATABASE_NAME, DECIMAL_HANDLING_MODE, DEFAULT_SNAPSHOT_LOCK_TIMEOUT_MILLIS, DEFAULT_UNAVAILABLE_VALUE_PLACEHOLDER, HOSTNAME, HOSTNAME_PATTERN, INCLUDE_SCHEMA_CHANGES, INCLUDE_SCHEMA_COMMENTS, MASK_COLUMN, MASK_COLUMN_WITH_HASH, MSG_KEY_COLUMNS, PASSWORD, PROPAGATE_COLUMN_SOURCE_TYPE, PROPAGATE_DATATYPE_SOURCE_TYPE, QUERY_TIMEOUT_MS, SCHEMA_EXCLUDE_LIST, SCHEMA_EXCLUDE_LIST_NAME, SCHEMA_INCLUDE_LIST, SCHEMA_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG, SCHEMA_INCLUDE_LIST_NAME, SNAPSHOT_FULL_COLUMN_SCAN_FORCE, SNAPSHOT_LOCK_TIMEOUT_MS, SNAPSHOT_SELECT_STATEMENT_OVERRIDES_BY_TABLE, SNAPSHOT_TABLES_ORDER_BY_ROW_COUNT, TABLE_EXCLUDE_LIST, TABLE_EXCLUDE_LIST_NAME, TABLE_IGNORE_BUILTIN, TABLE_INCLUDE_LIST, TABLE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG, TABLE_INCLUDE_LIST_NAME, TRUNCATE_COLUMN, UNAVAILABLE_VALUE_PLACEHOLDER, USERFields inherited from class io.debezium.config.CommonConnectorConfig
beanRegistry, BINARY_HANDLING_MODE, CUSTOM_CONVERTERS, CUSTOM_METRIC_TAGS, CUSTOM_POST_PROCESSORS, CUSTOM_RETRIABLE_EXCEPTION, DATABASE_CONFIG_PREFIX, DEFAULT_MAX_BATCH_SIZE, DEFAULT_MAX_QUEUE_SIZE, DEFAULT_MAX_QUEUE_SIZE_IN_BYTES, DEFAULT_MAX_RETRIES, DEFAULT_POLL_INTERVAL_MILLIS, DEFAULT_QUERY_FETCH_SIZE, DEFAULT_RETRIABLE_RESTART_WAIT, DRIVER_CONFIG_PREFIX, ERRORS_MAX_RETRIES, EVENT_CONVERTING_FAILURE_HANDLING_MODE, EVENT_PROCESSING_FAILURE_HANDLING_MODE, EXECUTOR_SHUTDOWN_TIMEOUT_SEC, FIELD_NAME_ADJUSTMENT_MODE, INCREMENTAL_SNAPSHOT_ALLOW_SCHEMA_CHANGES, INCREMENTAL_SNAPSHOT_CHUNK_SIZE, INCREMENTAL_SNAPSHOT_WATERMARKING_STRATEGY, isLogPositionCheckEnabled, LOG_POSITION_CHECK_ENABLED, logicalName, MAX_BATCH_SIZE, MAX_QUEUE_SIZE, MAX_QUEUE_SIZE_IN_BYTES, MAX_RETRIES_ON_ERROR, MULTI_PARTITION_MODE, NOTIFICATION_CONFIGURATION_FIELD_PREFIX_STRING, NOTIFICATION_ENABLED_CHANNELS, POLL_INTERVAL_MS, PROVIDE_TRANSACTION_METADATA, QUERY_FETCH_SIZE, RETRIABLE_RESTART_WAIT, SCHEMA_NAME_ADJUSTMENT_MODE, serviceRegistry, SIGNAL_DATA_COLLECTION, SIGNAL_ENABLED_CHANNELS, SIGNAL_POLL_INTERVAL_MS, SKIP_MESSAGES_WITHOUT_CHANGE, SKIPPED_OPERATIONS, SNAPSHOT_DELAY_MS, SNAPSHOT_FETCH_SIZE, SNAPSHOT_LOCKING_MODE_CUSTOM_NAME, SNAPSHOT_LOCKING_MODE_PROPERTY_NAME, SNAPSHOT_MAX_THREADS, SNAPSHOT_MODE_CONFIGURATION_BASED_SNAPSHOT_DATA, SNAPSHOT_MODE_CONFIGURATION_BASED_SNAPSHOT_ON_DATA_ERROR, SNAPSHOT_MODE_CONFIGURATION_BASED_SNAPSHOT_ON_SCHEMA_ERROR, SNAPSHOT_MODE_CONFIGURATION_BASED_SNAPSHOT_SCHEMA, SNAPSHOT_MODE_CONFIGURATION_BASED_START_STREAM, SNAPSHOT_MODE_CUSTOM_NAME, SNAPSHOT_MODE_PROPERTY_NAME, SNAPSHOT_MODE_TABLES, SNAPSHOT_QUERY_MODE, SNAPSHOT_QUERY_MODE_CUSTOM_NAME, snapshotLockingModeCustomName, snapshotModeConfigurationBasedSnapshotData, snapshotModeConfigurationBasedSnapshotOnDataError, snapshotModeConfigurationBasedSnapshotOnSchemaError, snapshotModeConfigurationBasedSnapshotSchema, snapshotModeConfigurationBasedStream, snapshotQueryMode, snapshotQueryModeCustomName, SOURCE_INFO_STRUCT_MAKER, TASK_ID, TOMBSTONES_ON_DELETE, TOPIC_NAME_PATTERN, TOPIC_PREFIX, TRANSACTION_METADATA_FACTORY -
Constructor Summary
ConstructorsConstructorDescriptionBinlogConnectorConfig(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorClazz, Configuration config, int defaultFetchSize) Create a binlog-based connector configuration. -
Method Summary
Modifier and TypeMethodDescriptionintabstract GtidSetFactoryintgetPort()longlongprotected abstract BinlogConnectorConfig.SnapshotLockingStrategystatic booleanisBuiltInDatabase(String databaseName) Check whether the specified database name is a built-in database.protected booleanCheck whether tests request global lock usage.static booleanisNotBuiltInTable(TableId tableId) Checks whether theTableIdrefers to a built-in table.booleanbooleanbooleanbooleanbooleanprotected booleanbooleanSpecifies whether the connector should use a cursor-fetch to read result sets.private static intvalidateEventDeserializationFailureHandlingModeNotSet(Configuration config, Field field, Field.ValidationOutput problems) Logs a deprecation warning when usingEVENT_DESERIALIZATION_FAILURE_HANDLING_MODE.private static intvalidateGtidSetExcludes(Configuration config, Field field, Field.ValidationOutput problems) Validate that GTID excludes aren't provided when GTID includes are in the configuration.private static intvalidateTimePrecisionMode(Configuration config, Field field, Field.ValidationOutput problems) Validate the time.precision.mode configuration.Methods inherited from class io.debezium.relational.HistorizedRelationalDatabaseConnectorConfig
ddlFilter, getHistoryRecordComparator, getSchemaHistory, multiPartitionMode, skipUnparseableDdlStatements, storeOnlyCapturedDatabases, storeOnlyCapturedTables, useCatalogBeforeSchemaMethods inherited from class io.debezium.relational.RelationalDatabaseConnectorConfig
createHeartbeat, getColumnFilter, getDecimalMode, getFieldNamer, getHeartbeatActionQuery, getJdbcConfig, getKeyMapper, getSnapshotSelectOverridesByTable, getTableFilters, getTableIdMapper, getUnavailableValuePlaceholder, isColumnsFiltered, isFullColumnScanRequired, isSchemaChangesHistoryEnabled, isSchemaCommentsHistoryEnabled, schemaExcludeList, schemaIncludeList, snapshotLockTimeout, snapshotOrderByRowCount, tableExcludeList, tableIncludeListMethods inherited from class io.debezium.config.CommonConnectorConfig
binaryHandlingMode, createCustomMetricTags, customConverterRegistry, customRetriableException, fieldNameAdjuster, getBeanRegistry, getConfig, getConnectorName, getContextName, getCustomMetricTags, getDataCollectionsToBeSnapshotted, getEnabledChannels, getEnabledNotificationChannels, getEventConvertingFailureHandlingMode, getEventProcessingFailureHandlingMode, getHeartbeatInterval, getHeartbeatTopicsPrefix, getIncrementalSnapshotChunkSize, getIncrementalSnapshotWatermarkingStrategy, getLogicalName, getMaxBatchSize, getMaxQueueSize, getMaxQueueSizeInBytes, getMaxRetriesOnError, getNotificationTopic, getPollInterval, getQueryFetchSize, getServiceRegistry, getSignalingDataCollectionId, getSignalPollInterval, getSkippedOperations, getSnapshotDelay, getSnapshotFetchSize, getSnapshotLockingMode, getSnapshotMaxThreads, getSnapshotModeCustomName, getSourceInfoStructMaker, getSourceInfoStructMaker, getSourceInfoStructMaker, getTaskId, getTopicNamingStrategy, getTopicNamingStrategy, getTransactionMetadataFactory, getTransactionMetadataFactory, isEmitTombstoneOnDelete, isIncrementalSnapshotSchemaChangesEnabled, isLogPositionCheckEnabled, isSignalDataCollection, parseSignallingMessage, schemaNameAdjuster, shouldProvideTransactionMetadata, skipMessagesWithoutChange, snapshotLockingModeCustomName, snapshotModeConfigurationBasedSnapshotData, snapshotModeConfigurationBasedSnapshotOnDataError, snapshotModeConfigurationBasedSnapshotOnSchemaError, snapshotModeConfigurationBasedSnapshotSchema, snapshotModeConfigurationBasedStream, snapshotQueryMode, snapshotQueryModeCustomName, validate, validateAndRecord, validateSkippedOperation, validateTopicName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TEST_DISABLE_GLOBAL_LOCKING
It is not possible to test disabled global locking locally as binlog-based connectors builds always provide global locking. So to bypass this limitation, it is necessary to provide a backdoor to the connector to disable it on its own.- See Also:
-
BUILT_IN_DB_NAMES
Set of all built-in database names that will generally be ignored by the connector. -
DEFAULT_PORT
private static final int DEFAULT_PORTThe default port for the binlog-based database.- See Also:
-
DEFAULT_BINLOG_BUFFER_SIZE
private static final int DEFAULT_BINLOG_BUFFER_SIZEThe default size of the binlog buffer used for examining transactions and deciding whether to propagate them or not. A size of0disables the buffer, all events will be passed directly as they are passed by the binlog client.- See Also:
-
PORT
-
TABLES_IGNORE_BUILTIN
-
STORE_ONLY_CAPTURED_DATABASES_DDL
-
ON_CONNECT_STATEMENTS
-
SERVER_ID
-
SERVER_ID_OFFSET
-
SSL_MODE
-
SSL_KEYSTORE
-
SSL_KEYSTORE_PASSWORD
-
SSL_TRUSTSTORE
-
SSL_TRUSTSTORE_PASSWORD
-
CONNECTION_TIMEOUT_MS
-
KEEP_ALIVE
-
KEEP_ALIVE_INTERVAL_MS
-
ROW_COUNT_FOR_STREAMING_RESULT_SETS
-
BUFFER_SIZE_FOR_BINLOG_READER
-
TOPIC_NAMING_STRATEGY
-
INCLUDE_SQL_QUERY
-
SNAPSHOT_MODE
-
TIME_PRECISION_MODE
-
BIGINT_UNSIGNED_HANDLING_MODE
-
EVENT_DESERIALIZATION_FAILURE_HANDLING_MODE
Deprecated.UseCommonConnectorConfig.EVENT_PROCESSING_FAILURE_HANDLING_MODEinstead, will be removed in Debezium 3.0. -
INCONSISTENT_SCHEMA_HANDLING_MODE
-
ENABLE_TIME_ADJUSTER
-
READ_ONLY_CONNECTION
-
GTID_SOURCE_INCLUDES
Specifies the GTID ranges to be included. Each binlog-database implementation has their own GTID specification, please see the binlog conenctor concrete implementation for details about the GTID inclusion range format. -
GTID_SOURCE_EXCLUDES
Specifies the GTID ranges to be excluded. Each binlog-database implementation has their own GTID specification, please see the binlog connector concrete implementation for details about the GTID exclusion range format. -
GTID_SOURCE_FILTER_DML_EVENTS
When set totrue, the connector will produce DML events for transactions that were written by the binlog-based database servers based on the matching GTID filters that were included in the connector configuration inGTID_SOURCE_INCLUDESandGTID_SOURCE_EXCLUDES, if specified. This defaults totrue, which requires that eitherGTID_SOURCE_INCLUDESorGTID_SOURCE_EXCLUDESmust be provided in the connector configuration. -
CONFIG_DEFINITION
-
config
-
snapshotMode
-
temporalPrecisionMode
-
connectionTimeout
-
inconsistentSchemaFailureHandlingMode
private final CommonConnectorConfig.EventProcessingFailureHandlingMode inconsistentSchemaFailureHandlingMode -
secureConnectionMode
-
bigIntUnsignedHandlingMode
-
readOnlyConnection
private final boolean readOnlyConnection
-
-
Constructor Details
-
BinlogConnectorConfig
public BinlogConnectorConfig(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorClazz, Configuration config, int defaultFetchSize) Create a binlog-based connector configuration.- Parameters:
connectorClazz- the connector class the configuration refersconfig- the configurationdefaultFetchSize- the default fetch size to be used
-
-
Method Details
-
supportsOperationFiltering
public boolean supportsOperationFiltering()- Overrides:
supportsOperationFilteringin classCommonConnectorConfig
-
supportsSchemaChangesDuringIncrementalSnapshot
protected boolean supportsSchemaChangesDuringIncrementalSnapshot()- Overrides:
supportsSchemaChangesDuringIncrementalSnapshotin classCommonConnectorConfig
-
getTemporalPrecisionMode
- Overrides:
getTemporalPrecisionModein classRelationalDatabaseConnectorConfig
-
getSnapshotMode
- Specified by:
getSnapshotModein classCommonConnectorConfig- Returns:
- which snapshot mode the connector intends to use
-
getConnectionTimeout
- Returns:
- the connection timeout duration
-
getInconsistentSchemaFailureHandlingMode
public CommonConnectorConfig.EventProcessingFailureHandlingMode getInconsistentSchemaFailureHandlingMode()- Returns:
- how inconsistent schema failures should be handled
-
getBigIntUnsignedHandlingMode
- Returns:
- the
BIGINT UNSIGNEDhandling mode
-
useCursorFetch
public boolean useCursorFetch()Specifies whether the connector should use a cursor-fetch to read result sets.- Returns:
- true to use a cursor-fetch; false otherwise
-
getHostName
- Returns:
- the database server host name
-
getPort
public int getPort()- Returns:
- the database server port
-
getUserName
- Returns:
- the database connection username
-
getPassword
- Returns:
- the database connection credentials
-
getServerId
public long getServerId()- Returns:
- the database cluster server unique identifier
-
getSslMode
- Returns:
- the SSL connection mode to use
-
isSslModeEnabled
public boolean isSslModeEnabled()- Returns:
- true if the connection should use SSL; false otherwise
-
getBufferSizeForStreamingChangeEventSource
public int getBufferSizeForStreamingChangeEventSource()- Returns:
- the buffer size for streaming change events
-
isSqlQueryIncluded
public boolean isSqlQueryIncluded()- Returns:
- whether the SQL query for a binlog event should be included in the event payload
-
getRowCountForLargeTable
public long getRowCountForLargeTable()- Returns:
- the number of rows a table needs to stream results rather than read all into memory.
-
isReadOnlyConnection
public boolean isReadOnlyConnection()- Returns:
- whether database connection should be treated as read-only.
-
isTimeAdjustedEnabled
public boolean isTimeAdjustedEnabled()- Returns:
- true if the time adjuster is enabled; false otherwise
-
getGtidSourceFilter
- Returns:
- the global transaction identifier source filter predicate
-
getGtidSetFactory
- Returns:
- the global transaction identifier set (
GtidSetfactory.
-
isGlobalLockUseRequested
protected boolean isGlobalLockUseRequested()Check whether tests request global lock usage.- Returns:
- true to use global locks, false otherwise
-
isBuiltInDatabase
Check whether the specified database name is a built-in database.- Parameters:
databaseName- the database name to check- Returns:
- true if the database is a built-in database; false otherwise
-
isNotBuiltInTable
Checks whether theTableIdrefers to a built-in table.- Parameters:
tableId- the relational table identifier, should not be null- Returns:
- true if the reference refers to a built-in table
-
getSnapshotLockingStrategy
- Returns:
- the connector-specific's
BinlogConnectorConfig.SnapshotLockingStrategy.
-
validateEventDeserializationFailureHandlingModeNotSet
private static int validateEventDeserializationFailureHandlingModeNotSet(Configuration config, Field field, Field.ValidationOutput problems) Logs a deprecation warning when usingEVENT_DESERIALIZATION_FAILURE_HANDLING_MODE. -
validateTimePrecisionMode
private static int validateTimePrecisionMode(Configuration config, Field field, Field.ValidationOutput problems) Validate the time.precision.mode configuration. Ifadaptiveis specified, this option has the potential to cause overflow which is why the option was deprecated and no longer supported for this connector. -
validateGtidSetExcludes
private static int validateGtidSetExcludes(Configuration config, Field field, Field.ValidationOutput problems) Validate that GTID excludes aren't provided when GTID includes are in the configuration.
-
CommonConnectorConfig.EVENT_PROCESSING_FAILURE_HANDLING_MODEinstead, will be removed in Debezium 3.0.