Class BinlogConnectorConfig


public abstract class BinlogConnectorConfig extends HistorizedRelationalDatabaseConnectorConfig
Configuration properties for binlog-based connectors.
Author:
Chris Cranford
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TEST_DISABLE_GLOBAL_LOCKING

      static final String 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

      protected static final Set<String> 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_PORT
      The default port for the binlog-based database.
      See Also:
    • DEFAULT_BINLOG_BUFFER_SIZE

      private static final int DEFAULT_BINLOG_BUFFER_SIZE
      The default size of the binlog buffer used for examining transactions and deciding whether to propagate them or not. A size of 0 disables the buffer, all events will be passed directly as they are passed by the binlog client.
      See Also:
    • PORT

      public static final Field PORT
    • TABLES_IGNORE_BUILTIN

      public static final Field TABLES_IGNORE_BUILTIN
    • STORE_ONLY_CAPTURED_DATABASES_DDL

      public static final Field STORE_ONLY_CAPTURED_DATABASES_DDL
    • ON_CONNECT_STATEMENTS

      public static final Field ON_CONNECT_STATEMENTS
    • SERVER_ID

      public static final Field SERVER_ID
    • SERVER_ID_OFFSET

      public static final Field SERVER_ID_OFFSET
    • SSL_MODE

      public static final Field SSL_MODE
    • SSL_KEYSTORE

      public static final Field SSL_KEYSTORE
    • SSL_KEYSTORE_PASSWORD

      public static final Field SSL_KEYSTORE_PASSWORD
    • SSL_TRUSTSTORE

      public static final Field SSL_TRUSTSTORE
    • SSL_TRUSTSTORE_PASSWORD

      public static final Field SSL_TRUSTSTORE_PASSWORD
    • CONNECTION_TIMEOUT_MS

      public static final Field CONNECTION_TIMEOUT_MS
    • KEEP_ALIVE

      public static final Field KEEP_ALIVE
    • KEEP_ALIVE_INTERVAL_MS

      public static final Field KEEP_ALIVE_INTERVAL_MS
    • USE_NONGRACEFUL_DISCONNECT

      public static final Field USE_NONGRACEFUL_DISCONNECT
    • ROW_COUNT_FOR_STREAMING_RESULT_SETS

      public static final Field ROW_COUNT_FOR_STREAMING_RESULT_SETS
    • BUFFER_SIZE_FOR_BINLOG_READER

      public static final Field BUFFER_SIZE_FOR_BINLOG_READER
    • TOPIC_NAMING_STRATEGY

      public static final Field TOPIC_NAMING_STRATEGY
    • INCLUDE_SQL_QUERY

      public static final Field INCLUDE_SQL_QUERY
    • SNAPSHOT_MODE

      public static final Field SNAPSHOT_MODE
    • TIME_PRECISION_MODE

      public static final Field TIME_PRECISION_MODE
    • BIGINT_UNSIGNED_HANDLING_MODE

      public static final Field BIGINT_UNSIGNED_HANDLING_MODE
    • EVENT_DESERIALIZATION_FAILURE_HANDLING_MODE

      @Deprecated public static final Field EVENT_DESERIALIZATION_FAILURE_HANDLING_MODE
      Deprecated.
      Use CommonConnectorConfig.EVENT_PROCESSING_FAILURE_HANDLING_MODE instead, will be removed in Debezium 3.0.
    • INCONSISTENT_SCHEMA_HANDLING_MODE

      public static final Field INCONSISTENT_SCHEMA_HANDLING_MODE
    • ENABLE_TIME_ADJUSTER

      public static final Field ENABLE_TIME_ADJUSTER
    • READ_ONLY_CONNECTION

      public static final Field READ_ONLY_CONNECTION
    • GTID_SOURCE_INCLUDES

      public static final Field 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

      public static final Field 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

      public static final Field GTID_SOURCE_FILTER_DML_EVENTS
      When set to true, 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 in GTID_SOURCE_INCLUDES and GTID_SOURCE_EXCLUDES, if specified.

      This defaults to true, which requires that either GTID_SOURCE_INCLUDES or GTID_SOURCE_EXCLUDES must be provided in the connector configuration.
    • CONFIG_DEFINITION

      protected static final ConfigDefinition CONFIG_DEFINITION
    • config

      private final Configuration config
    • snapshotMode

      private final BinlogConnectorConfig.SnapshotMode snapshotMode
    • temporalPrecisionMode

      private final TemporalPrecisionMode temporalPrecisionMode
    • connectionTimeout

      private final Duration connectionTimeout
    • inconsistentSchemaFailureHandlingMode

      private final CommonConnectorConfig.EventProcessingFailureHandlingMode inconsistentSchemaFailureHandlingMode
    • secureConnectionMode

      private final BinlogConnectorConfig.SecureConnectionMode secureConnectionMode
    • bigIntUnsignedHandlingMode

      private final BinlogConnectorConfig.BigIntUnsignedHandlingMode 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 refers
      config - the configuration
      defaultFetchSize - the default fetch size to be used
  • Method Details

    • supportsOperationFiltering

      public boolean supportsOperationFiltering()
      Overrides:
      supportsOperationFiltering in class CommonConnectorConfig
    • supportsSchemaChangesDuringIncrementalSnapshot

      protected boolean supportsSchemaChangesDuringIncrementalSnapshot()
      Overrides:
      supportsSchemaChangesDuringIncrementalSnapshot in class CommonConnectorConfig
    • getTemporalPrecisionMode

      public TemporalPrecisionMode getTemporalPrecisionMode()
      Overrides:
      getTemporalPrecisionMode in class RelationalDatabaseConnectorConfig
    • getSnapshotMode

      public EnumeratedValue getSnapshotMode()
      Specified by:
      getSnapshotMode in class CommonConnectorConfig
      Returns:
      which snapshot mode the connector intends to use
    • getConnectionTimeout

      public Duration getConnectionTimeout()
      Returns:
      the connection timeout duration
    • getInconsistentSchemaFailureHandlingMode

      public CommonConnectorConfig.EventProcessingFailureHandlingMode getInconsistentSchemaFailureHandlingMode()
      Returns:
      how inconsistent schema failures should be handled
    • getBigIntUnsignedHandlingMode

      public BinlogConnectorConfig.BigIntUnsignedHandlingMode getBigIntUnsignedHandlingMode()
      Returns:
      the BIGINT UNSIGNED handling 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

      public String getHostName()
      Returns:
      the database server host name
    • getPort

      public int getPort()
      Returns:
      the database server port
    • getUserName

      public String getUserName()
      Returns:
      the database connection username
    • getPassword

      public String 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

      public abstract Predicate<String> getGtidSourceFilter()
      Returns:
      the global transaction identifier source filter predicate
    • getGtidSetFactory

      public abstract GtidSetFactory getGtidSetFactory()
      Returns:
      the global transaction identifier set (GtidSet factory.
    • isGlobalLockUseRequested

      protected boolean isGlobalLockUseRequested()
      Check whether tests request global lock usage.
      Returns:
      true to use global locks, false otherwise
    • isBuiltInDatabase

      public static boolean isBuiltInDatabase(String databaseName)
      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

      public static boolean isNotBuiltInTable(TableId tableId)
      Checks whether the TableId refers 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

      protected abstract BinlogConnectorConfig.SnapshotLockingStrategy 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 using EVENT_DESERIALIZATION_FAILURE_HANDLING_MODE.
    • validateTimePrecisionMode

      private static int validateTimePrecisionMode(Configuration config, Field field, Field.ValidationOutput problems)
      Validate the time.precision.mode configuration.

      If adaptive is 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.
    • usesNonGracefulDisconnect

      public boolean usesNonGracefulDisconnect()