Package io.debezium.engine
Interface DebeziumEngine.Builder<R>
- Enclosing interface:
- DebeziumEngine<R>
public static interface DebeziumEngine.Builder<R>
A builder to set up and create
DebeziumEngine instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a new connector with the information previously supplied to this builder.notifying(DebeziumEngine.ChangeConsumer<R> handler) Pass a custom ChangeConsumer override the default implementation, this allows for more complex handling of records for batch and async handlingCall the specified function for everydata change eventread from the source database.using(DebeziumEngine.CompletionCallback completionCallback) When the engine'sRunnable.run()method completes, call the supplied function with the results.using(DebeziumEngine.ConnectorCallback connectorCallback) During the engine'sRunnable.run()method, call the supplied the supplied function at different stages according to the completion state of each component running within the engine (connectors, tasks etc)using(OffsetCommitPolicy policy) During the engine'sRunnable.run()method, decide when the offsets should be committed into theOffsetBackingStore.using(ClassLoader classLoader) Use the specified class loader to find all necessary classes.Use the specified clock when needing to determine the current time.using(Properties config) Use the specified configuration for the connector.
-
Method Details
-
notifying
Call the specified function for everydata change eventread from the source database. This method must be called with a non-null consumer.- Parameters:
consumer- the consumer function- Returns:
- this builder object so methods can be chained together; never null
-
notifying
Pass a custom ChangeConsumer override the default implementation, this allows for more complex handling of records for batch and async handling- Parameters:
handler- the consumer function- Returns:
- this builder object so methods can be chained together; never null
-
using
Use the specified configuration for the connector. The configuration is assumed to already be valid.- Parameters:
config- the configuration- Returns:
- this builder object so methods can be chained together; never null
-
using
Use the specified class loader to find all necessary classes. Passingnullor not calling this method results in the connector using this class's class loader.- Parameters:
classLoader- the class loader- Returns:
- this builder object so methods can be chained together; never null
-
using
Use the specified clock when needing to determine the current time. Passingnullor not calling this method results in the connector using thesystem clock.- Parameters:
clock- the clock- Returns:
- this builder object so methods can be chained together; never null
-
using
When the engine'sRunnable.run()method completes, call the supplied function with the results.- Parameters:
completionCallback- the callback function; may be null if errors should be written to the log- Returns:
- this builder object so methods can be chained together; never null
-
using
During the engine'sRunnable.run()method, call the supplied the supplied function at different stages according to the completion state of each component running within the engine (connectors, tasks etc)- Parameters:
connectorCallback- the callback function; may be null- Returns:
- this builder object so methods can be chained together; never null
-
using
During the engine'sRunnable.run()method, decide when the offsets should be committed into theOffsetBackingStore.- Parameters:
policy-- Returns:
- this builder object so methods can be chained together; never null
-
build
DebeziumEngine<R> build()Build a new connector with the information previously supplied to this builder.- Returns:
- the embedded connector; never null
- Throws:
IllegalArgumentException- if aconfigurationorconsumer functionwere not supplied before this method is called
-