Package io.debezium.engine
Interface DebeziumEngine.Builder<R>
-
- Enclosing interface:
- DebeziumEngine<R>
public static interface DebeziumEngine.Builder<R>A builder to set up and createDebeziumEngineinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DebeziumEngine<R>build()Build a new connector with the information previously supplied to this builder.DebeziumEngine.Builder<R>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 handlingDebeziumEngine.Builder<R>notifying(Consumer<R> consumer)Call the specified function for everydata change eventread from the source database.DebeziumEngine.Builder<R>using(DebeziumEngine.CompletionCallback completionCallback)When the engine'sRunnable.run()method completes, call the supplied function with the results.DebeziumEngine.Builder<R>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)DebeziumEngine.Builder<R>using(OffsetCommitPolicy policy)During the engine'sRunnable.run()method, decide when the offsets should be committed into theOffsetBackingStore.DebeziumEngine.Builder<R>using(ClassLoader classLoader)Use the specified class loader to find all necessary classes.DebeziumEngine.Builder<R>using(Clock clock)Use the specified clock when needing to determine the current time.DebeziumEngine.Builder<R>using(Properties config)Use the specified configuration for the connector.
-
-
-
Method Detail
-
notifying
DebeziumEngine.Builder<R> notifying(Consumer<R> consumer)
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
DebeziumEngine.Builder<R> 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 handling- Parameters:
handler- the consumer function- Returns:
- this builder object so methods can be chained together; never null
-
using
DebeziumEngine.Builder<R> using(Properties config)
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
DebeziumEngine.Builder<R> using(ClassLoader classLoader)
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
DebeziumEngine.Builder<R> using(Clock clock)
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
DebeziumEngine.Builder<R> using(DebeziumEngine.CompletionCallback completionCallback)
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
DebeziumEngine.Builder<R> 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)- Parameters:
connectorCallback- the callback function; may be null- Returns:
- this builder object so methods can be chained together; never null
-
using
DebeziumEngine.Builder<R> using(OffsetCommitPolicy policy)
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
-
-