Class DebeziumCdcSources.Builder<T>

java.lang.Object
com.hazelcast.enterprise.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.enterprise.jet.cdc.impl.DebeziumConfig config
    • recordMappingFunction

      protected RecordMappingFunction<T> recordMappingFunction
    • engineBuilderSupplier

      protected com.hazelcast.function.SupplierEx<io.debezium.engine.DebeziumEngine.BuilderFactory> engineBuilderSupplier
  • 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.
    • withDefaultEngine

      @Nonnull public DebeziumCdcSources.Builder<T> withDefaultEngine()
      Changes the engine used to default embedded engine.

      This engine is most predictable as it's single-threaded. If you want to use multiple threads for event reading, please use withAsyncEngine().

    • withAsyncEngine

      @Nonnull public DebeziumCdcSources.Builder<T> withAsyncEngine()
      Changes the engine used to async embedded engine.

      Async engine allows multithreaded reading, however you need to deal with async world and it's quirks.

    • 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.
    • setProperty

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

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

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