Package com.hazelcast.enterprise.jet.cdc
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
A builder to configure a CDC source that streams the change data from
a Debezium-supported database to Hazelcast Jet.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.hazelcast.enterprise.jet.cdc.impl.DebeziumConfig
protected com.hazelcast.function.SupplierEx<io.debezium.engine.DebeziumEngine.BuilderFactory>
protected RecordMappingFunction<T>
-
Constructor Summary
ModifierConstructorDescriptionprotected
Builder
(String name, String connectorClass, RecordMappingFunction<T> recordMappingFunction) -
Method Summary
Modifier and TypeMethodDescriptioncom.hazelcast.jet.pipeline.StreamSource<T>
build()
Returns the CDC source based on the properties set.Sets the return type of the source toChangeRecord
.<T_NEW> DebeziumCdcSources.Builder<T_NEW>
customMapping
(RecordMappingFunction<T_NEW> recordMappingFunction) Sets the return type of the source to user defined#T_NEW
type.json()
Sets the return type of the source toMap.Entry
with key and value beingSourceRecord
's key and value, parsed to json string.setDatabaseExcludeList
(String... databaseNameRegExps) Optional regular expressions that match databases to be excluded from monitoring; any table not included in the exclude list will be monitored.setDatabaseIncludeList
(String... databaseNameRegExps) Optional regular expressions that match databases to be monitored; any database not included in the include list will be excluded from monitoring.setProperty
(String key, boolean value) Sets a source property.setProperty
(String key, int value) Sets a source property.setProperty
(String key, long value) Sets a source property.setProperty
(String key, String value) Sets a source property.setTableExcludeList
(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.setTableIncludeList
(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.Changes the engine used to async embedded engine.Changes the engine used to default embedded engine.withErrorMaxRetries
(int errorRetryCount) Sets the maximum retry count in case of errors.withSequenceExtractor
(Class<? extends SequenceExtractor> sequenceExtractorClass) Sets theSequenceExtractor
class property.
-
Field Details
-
config
protected final com.hazelcast.enterprise.jet.cdc.impl.DebeziumConfig config -
recordMappingFunction
-
engineBuilderSupplier
protected com.hazelcast.function.SupplierEx<io.debezium.engine.DebeziumEngine.BuilderFactory> engineBuilderSupplier
-
-
Constructor Details
-
Builder
protected Builder(@Nonnull String name, @Nonnull String connectorClass, @Nonnull RecordMappingFunction<T> recordMappingFunction)
-
-
Method Details
-
changeRecord
Sets the return type of the source toChangeRecord
. -
json
Sets the return type of the source toMap.Entry
with key and value beingSourceRecord
'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 theSequenceExtractor
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
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
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
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 withdatabase 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 withdatabase 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 withtable 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 withtable 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
Sets a source property. These properties are passed to Debezium. -
setProperty
Sets a source property. These properties are passed to Debezium. -
setProperty
Sets a source property. These properties are passed to Debezium. -
build
Returns the CDC source based on the properties set.
-