Class DebeziumCdcSources.Builder<T>

java.lang.Object
com.hazelcast.jet.cdc.DebeziumCdcSources.Builder<T>
Type Parameters:
T - type of items handled by the source
Direct Known Subclasses:
MySqlCdcSources.Builder, PostgresCdcSources.Builder
Enclosing class:
DebeziumCdcSources

public static class DebeziumCdcSources.Builder<T> extends Object
A builder to configure a CDC source that streams the change data from a Debezium-supported database to Hazelcast Jet.
  • Field Details

    • config

      protected final com.hazelcast.jet.cdc.impl.DebeziumConfig config
    • recordMappingFunction

      protected RecordMappingFunction<T> recordMappingFunction
  • Constructor Details

  • Method Details

    • changeRecord

      @Nonnull public DebeziumCdcSources.Builder<ChangeRecord> changeRecord()
      Sets the return type of the source to ChangeRecord.
    • json

      Sets the return type of the source to Map.Entry with key and value being SourceRecord's key and value, parsed to json string.
    • customMapping

      @Nonnull public <T_NEW> DebeziumCdcSources.Builder<T_NEW> customMapping(@Nonnull RecordMappingFunction<T_NEW> recordMappingFunction)
      Sets the return type of the source to user defined #T_NEW type. Mapping will be performed by user-defined mapping function.
    • withSequenceExtractor

      @Nonnull public DebeziumCdcSources.Builder<T> withSequenceExtractor(Class<? extends SequenceExtractor> sequenceExtractorClass)
      Sets the SequenceExtractor class property.

      Sequence extractor is used to determine monotonically increasing order of CDC order, that can be used later in WriteCdcP.

      Parameters:
      sequenceExtractorClass - Class of the SequenceExtractor implementation. Must be on the classpath during execution.
    • withErrorMaxRetries

      @Nonnull public DebeziumCdcSources.Builder<T> withErrorMaxRetries(int errorRetryCount)
      Sets the maximum retry count in case of errors.

      Default value is -1, which means infinite retries.

    • setDatabaseIncludeList

      @Nonnull public DebeziumCdcSources.Builder<T> setDatabaseIncludeList(@Nonnull String... databaseNameRegExps)
      Optional regular expressions that match databases to be monitored; any database not included in the include list will be excluded from monitoring. By default, the connector will monitor all databases. May not be used with database exclude list.
    • setDatabaseExcludeList

      @Nonnull public DebeziumCdcSources.Builder<T> setDatabaseExcludeList(@Nonnull String... databaseNameRegExps)
      Optional regular expressions that match databases to be excluded from monitoring; any table not included in the exclude list will be monitored. May not be used with database include list.
    • setTableIncludeList

      @Nonnull public DebeziumCdcSources.Builder<T> setTableIncludeList(@Nonnull String... tableNameRegExps)
      Optional regular expressions that match fully-qualified table identifiers for tables to be monitored; any table not included in the whitelist will be excluded from monitoring. Each identifier is of the form schemaName.tableName. By default, the connector will monitor every non-system table in each monitored database. May not be used with table exclude list.
    • setTableExcludeList

      @Nonnull public DebeziumCdcSources.Builder<T> setTableExcludeList(@Nonnull String... tableNameRegExps)
      Optional regular expressions that match fully-qualified table identifiers for tables to be excluded from monitoring; any table not included in the exclude list will be monitored. Each identifier is of the form schemaName.tableName. May not be used with table include list.
    • setProperty

      @Nonnull public DebeziumCdcSources.Builder<T> setProperty(@Nonnull String key, @Nonnull String value)
      Sets a source property. These properties are passed to Debezium.
    • setProperty

      @Nonnull public DebeziumCdcSources.Builder<T> setProperty(@Nonnull String key, int value)
      Sets a source property. These properties are passed to Debezium.
      Since:
      6.0
    • setProperty

      @Nonnull public DebeziumCdcSources.Builder<T> setProperty(@Nonnull String key, long value)
      Sets a source property. These properties are passed to Debezium.
      Since:
      6.0
    • setProperty

      @Nonnull public DebeziumCdcSources.Builder<T> setProperty(@Nonnull String key, boolean value)
      Sets a source property. These properties are passed to Debezium.
      Since:
      6.0
    • enableSnapshotTracking

      @Nonnull public DebeziumCdcSources.Builder<T> enableSnapshotTracking()
      If called, enables the usage of SnapshotCompletionListener to track if initial snapshot has completed.

      Listener uses SnapshotCompletionListener executor to check completion statuses on all members. If you need to configure security or want to customize other parameters of executor that will handle checks, please update configuration for SnapshotCompletionListener executor. CDC module must be present on all nodes in order to use this functionality.

      Since:
      6.0
    • build

      @Nonnull public StreamSource<T> build()
      Returns the CDC source based on the properties set.