Class CommonConnectorConfig

java.lang.Object
io.debezium.config.CommonConnectorConfig
Direct Known Subclasses:
RelationalDatabaseConnectorConfig

public abstract class CommonConnectorConfig extends Object
Configuration options common to all Debezium connectors.
Author:
Gunnar Morling
  • Field Details

    • TASK_ID

      public static final String TASK_ID
      See Also:
    • TOPIC_NAME_PATTERN

      public static final Pattern TOPIC_NAME_PATTERN
    • MULTI_PARTITION_MODE

      public static final String MULTI_PARTITION_MODE
      See Also:
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • CONFLUENT_AVRO_CONVERTER

      private static final String CONFLUENT_AVRO_CONVERTER
      See Also:
    • APICURIO_AVRO_CONVERTER

      private static final String APICURIO_AVRO_CONVERTER
      See Also:
    • DEFAULT_MAX_QUEUE_SIZE

      public static final int DEFAULT_MAX_QUEUE_SIZE
      See Also:
    • DEFAULT_MAX_BATCH_SIZE

      public static final int DEFAULT_MAX_BATCH_SIZE
      See Also:
    • DEFAULT_QUERY_FETCH_SIZE

      public static final int DEFAULT_QUERY_FETCH_SIZE
      See Also:
    • DEFAULT_POLL_INTERVAL_MILLIS

      public static final long DEFAULT_POLL_INTERVAL_MILLIS
      See Also:
    • DATABASE_CONFIG_PREFIX

      public static final String DATABASE_CONFIG_PREFIX
      See Also:
    • DRIVER_CONFIG_PREFIX

      public static final String DRIVER_CONFIG_PREFIX
      See Also:
    • CONVERTER_TYPE_SUFFIX

      private static final String CONVERTER_TYPE_SUFFIX
      See Also:
    • DEFAULT_RETRIABLE_RESTART_WAIT

      public static final long DEFAULT_RETRIABLE_RESTART_WAIT
      See Also:
    • DEFAULT_MAX_QUEUE_SIZE_IN_BYTES

      public static final long DEFAULT_MAX_QUEUE_SIZE_IN_BYTES
      See Also:
    • NOTIFICATION_CONFIGURATION_FIELD_PREFIX_STRING

      public static final String NOTIFICATION_CONFIGURATION_FIELD_PREFIX_STRING
      See Also:
    • TOPIC_PREFIX

      public static final Field TOPIC_PREFIX
    • RETRIABLE_RESTART_WAIT

      public static final Field RETRIABLE_RESTART_WAIT
    • TOMBSTONES_ON_DELETE

      public static final Field TOMBSTONES_ON_DELETE
    • MAX_QUEUE_SIZE

      public static final Field MAX_QUEUE_SIZE
    • MAX_BATCH_SIZE

      public static final Field MAX_BATCH_SIZE
    • POLL_INTERVAL_MS

      public static final Field POLL_INTERVAL_MS
    • MAX_QUEUE_SIZE_IN_BYTES

      public static final Field MAX_QUEUE_SIZE_IN_BYTES
    • SNAPSHOT_DELAY_MS

      public static final Field SNAPSHOT_DELAY_MS
    • SNAPSHOT_FETCH_SIZE

      public static final Field SNAPSHOT_FETCH_SIZE
    • INCREMENTAL_SNAPSHOT_CHUNK_SIZE

      public static final Field INCREMENTAL_SNAPSHOT_CHUNK_SIZE
    • INCREMENTAL_SNAPSHOT_ALLOW_SCHEMA_CHANGES

      public static final Field INCREMENTAL_SNAPSHOT_ALLOW_SCHEMA_CHANGES
    • SNAPSHOT_MODE_TABLES

      public static final Field SNAPSHOT_MODE_TABLES
    • PROVIDE_TRANSACTION_METADATA

      public static final Field PROVIDE_TRANSACTION_METADATA
    • EVENT_PROCESSING_FAILURE_HANDLING_MODE

      public static final Field EVENT_PROCESSING_FAILURE_HANDLING_MODE
    • CUSTOM_CONVERTERS

      public static final Field CUSTOM_CONVERTERS
    • SKIPPED_OPERATIONS

      public static final Field SKIPPED_OPERATIONS
    • SKIP_MESSAGES_WITHOUT_CHANGE

      public static final Field SKIP_MESSAGES_WITHOUT_CHANGE
      Specifies whether to skip messages containing no updates in included columns
    • BINARY_HANDLING_MODE

      public static final Field BINARY_HANDLING_MODE
    • SCHEMA_NAME_ADJUSTMENT_MODE

      public static final Field SCHEMA_NAME_ADJUSTMENT_MODE
    • FIELD_NAME_ADJUSTMENT_MODE

      public static final Field FIELD_NAME_ADJUSTMENT_MODE
    • QUERY_FETCH_SIZE

      public static final Field QUERY_FETCH_SIZE
    • SNAPSHOT_MAX_THREADS

      public static final Field SNAPSHOT_MAX_THREADS
    • SIGNAL_DATA_COLLECTION

      public static final Field SIGNAL_DATA_COLLECTION
    • SIGNAL_POLL_INTERVAL_MS

      public static final Field SIGNAL_POLL_INTERVAL_MS
    • SIGNAL_ENABLED_CHANNELS

      public static final Field SIGNAL_ENABLED_CHANNELS
    • TOPIC_NAMING_STRATEGY

      public static final Field TOPIC_NAMING_STRATEGY
    • CUSTOM_RETRIABLE_EXCEPTION

      public static final Field CUSTOM_RETRIABLE_EXCEPTION
    • NOTIFICATION_ENABLED_CHANNELS

      public static final Field NOTIFICATION_ENABLED_CHANNELS
    • CONFIG_DEFINITION

      protected static final ConfigDefinition CONFIG_DEFINITION
    • config

      private final Configuration config
    • emitTombstoneOnDelete

      private final boolean emitTombstoneOnDelete
    • maxQueueSize

      private final int maxQueueSize
    • maxBatchSize

      private final int maxBatchSize
    • maxQueueSizeInBytes

      private final long maxQueueSizeInBytes
    • pollInterval

      private final Duration pollInterval
    • logicalName

      protected final String logicalName
    • heartbeatTopicsPrefix

      private final String heartbeatTopicsPrefix
    • heartbeatInterval

      private final Duration heartbeatInterval
    • snapshotDelay

      private final Duration snapshotDelay
    • retriableRestartWait

      private final Duration retriableRestartWait
    • snapshotFetchSize

      private final int snapshotFetchSize
    • incrementalSnapshotChunkSize

      private final int incrementalSnapshotChunkSize
    • incrementalSnapshotAllowSchemaChanges

      private final boolean incrementalSnapshotAllowSchemaChanges
    • snapshotMaxThreads

      private final int snapshotMaxThreads
    • queryFetchSize

      private final Integer queryFetchSize
    • sourceInfoStructMaker

      private final SourceInfoStructMaker<? extends AbstractSourceInfo> sourceInfoStructMaker
    • shouldProvideTransactionMetadata

      private final boolean shouldProvideTransactionMetadata
    • eventProcessingFailureHandlingMode

      private final CommonConnectorConfig.EventProcessingFailureHandlingMode eventProcessingFailureHandlingMode
    • customConverterRegistry

      private final CustomConverterRegistry customConverterRegistry
    • binaryHandlingMode

      private final CommonConnectorConfig.BinaryHandlingMode binaryHandlingMode
    • schemaNameAdjustmentMode

      private final CommonConnectorConfig.SchemaNameAdjustmentMode schemaNameAdjustmentMode
    • fieldNameAdjustmentMode

      private final CommonConnectorConfig.FieldNameAdjustmentMode fieldNameAdjustmentMode
    • signalingDataCollection

      private final String signalingDataCollection
    • signalPollInterval

      private final Duration signalPollInterval
    • signalEnabledChannels

      private final List<String> signalEnabledChannels
    • skippedOperations

      private final EnumSet<Envelope.Operation> skippedOperations
    • taskId

      private final String taskId
    • skipMessagesWithoutChange

      private final boolean skipMessagesWithoutChange
    • notificationTopicName

      private final String notificationTopicName
    • enabledNotificationChannels

      private final List<String> enabledNotificationChannels
  • Constructor Details

    • CommonConnectorConfig

      protected CommonConnectorConfig(Configuration config, int defaultSnapshotFetchSize)
  • Method Details

    • getSignalEnabledChannels

      private static List<String> getSignalEnabledChannels(Configuration config)
    • determineSkippedOperations

      private static EnumSet<Envelope.Operation> determineSkippedOperations(Configuration config)
    • getConfig

      @Deprecated public Configuration getConfig()
      Deprecated.
      Provides access to the "raw" config instance. In most cases, access via typed getters for individual properties on the connector config class should be preferred. TODO this should be protected in the future to force proper facade methods based access / encapsulation
    • isEmitTombstoneOnDelete

      public boolean isEmitTombstoneOnDelete()
    • getMaxQueueSize

      public int getMaxQueueSize()
    • getMaxBatchSize

      public int getMaxBatchSize()
    • getMaxQueueSizeInBytes

      public long getMaxQueueSizeInBytes()
    • getPollInterval

      public Duration getPollInterval()
    • getLogicalName

      public String getLogicalName()
    • getContextName

      public abstract String getContextName()
    • getConnectorName

      public abstract String getConnectorName()
    • getHeartbeatTopicsPrefix

      public String getHeartbeatTopicsPrefix()
    • getHeartbeatInterval

      public Duration getHeartbeatInterval()
    • getRetriableRestartWait

      public Duration getRetriableRestartWait()
    • getSnapshotDelay

      public Duration getSnapshotDelay()
    • getSnapshotFetchSize

      public int getSnapshotFetchSize()
    • getSnapshotMaxThreads

      public int getSnapshotMaxThreads()
    • getQueryFetchSize

      public int getQueryFetchSize()
    • getIncrementalSnapshotChunkSize

      public int getIncrementalSnapshotChunkSize()
    • getNotificationTopic

      public String getNotificationTopic()
    • getEnabledNotificationChannels

      public List<String> getEnabledNotificationChannels()
    • shouldProvideTransactionMetadata

      public boolean shouldProvideTransactionMetadata()
    • skipMessagesWithoutChange

      public boolean skipMessagesWithoutChange()
    • getEventProcessingFailureHandlingMode

      public CommonConnectorConfig.EventProcessingFailureHandlingMode getEventProcessingFailureHandlingMode()
    • customConverterRegistry

      public CustomConverterRegistry customConverterRegistry()
    • supportsOperationFiltering

      public boolean supportsOperationFiltering()
      Whether a particular connector supports an optimized way for implementing operation skipping, or not.
    • supportsSchemaChangesDuringIncrementalSnapshot

      protected boolean supportsSchemaChangesDuringIncrementalSnapshot()
    • isIncrementalSnapshotSchemaChangesEnabled

      public boolean isIncrementalSnapshotSchemaChangesEnabled()
    • getTopicNamingStrategy

      public TopicNamingStrategy getTopicNamingStrategy(Field topicNamingStrategyField)
    • getTopicNamingStrategy

      public TopicNamingStrategy getTopicNamingStrategy(Field topicNamingStrategyField, boolean multiPartitionMode)
    • getCustomConverters

      private List<CustomConverter<org.apache.kafka.connect.data.SchemaBuilder,ConvertedField>> getCustomConverters()
    • getSourceInfoStructMaker

      public <T extends AbstractSourceInfo> SourceInfoStructMaker<T> getSourceInfoStructMaker()
    • getSkippedOperations

      public EnumSet<Envelope.Operation> getSkippedOperations()
    • getDataCollectionsToBeSnapshotted

      public Set<Pattern> getDataCollectionsToBeSnapshotted()
    • isSchemaChangesHistoryEnabled

      public boolean isSchemaChangesHistoryEnabled()
      Returns:
      true if the connector should emit messages about schema changes into a public facing topic.
    • isSchemaCommentsHistoryEnabled

      public boolean isSchemaCommentsHistoryEnabled()
      Returns:
      true if the connector should emit messages which include table and column comments.
    • validate

      public boolean validate(Iterable<Field> fields, Field.ValidationOutput problems)
      Validates the supplied fields in this configuration. Extra fields not described by the supplied fields parameter will not be validated.
      Parameters:
      fields - the fields
      problems - the consumer to eb called with each problem; never null
      Returns:
      true if the value is considered valid, or false if it is not valid
    • validateAndRecord

      public boolean validateAndRecord(Iterable<Field> fields, Consumer<String> problems)
      Validate the supplied fields in this configuration. Extra fields not described by the supplied fields parameter will not be validated.
      Parameters:
      fields - the fields
      problems - the consumer to be called with each problem; never null
      Returns:
      true if the value is considered valid, or false if it is not valid
    • validateMaxQueueSize

      private static int validateMaxQueueSize(Configuration config, Field field, Field.ValidationOutput problems)
    • validateSkippedOperation

      protected static int validateSkippedOperation(Configuration config, Field field, Field.ValidationOutput problems)
    • isUsingAvroConverter

      private static boolean isUsingAvroConverter(Configuration config)
    • getSourceInfoStructMaker

      protected abstract SourceInfoStructMaker<?> getSourceInfoStructMaker(CommonConnectorConfig.Version version)
      Returns the connector-specific SourceInfoStructMaker based on the given configuration.
    • binaryHandlingMode

      public CommonConnectorConfig.BinaryHandlingMode binaryHandlingMode()
    • schemaNameAdjuster

      public SchemaNameAdjuster schemaNameAdjuster()
    • fieldNameAdjuster

      public SchemaNameAdjuster fieldNameAdjuster()
    • getSignalingDataCollectionId

      public String getSignalingDataCollectionId()
    • getSignalPollInterval

      public Duration getSignalPollInterval()
    • getEnabledChannels

      public List<String> getEnabledChannels()
    • parseSignallingMessage

      public Optional<String[]> parseSignallingMessage(org.apache.kafka.connect.data.Struct value)
    • isSignalDataCollection

      public boolean isSignalDataCollection(DataCollectionId dataCollectionId)
    • customRetriableException

      public Optional<String> customRetriableException()
    • getMaxRetriesOnError

      public int getMaxRetriesOnError()
    • getTaskId

      public String getTaskId()
    • createHeartbeat

      public Heartbeat createHeartbeat(TopicNamingStrategy topicNamingStrategy, SchemaNameAdjuster schemaNameAdjuster, HeartbeatConnectionProvider connectionProvider, HeartbeatErrorHandler errorHandler)
    • validateTopicName

      public static int validateTopicName(Configuration config, Field field, Field.ValidationOutput problems)