Interface DebeziumEngine<R>
- All Superinterfaces:
AutoCloseable,Closeable,Runnable
SourceConnector within an application's process. The engine
is entirely standalone and only talks with the source system; no Kafka, Kafka Connect, or Zookeeper processes are needed.
Applications using the engine simply set one up and supply a consumer function to which the
engine will pass all records containing database change events.
With the engine, the application that runs the connector assumes all responsibility for fault tolerance, scalability, and durability. Additionally, applications must specify how the engine can store its relational database schema history and offsets. By default, this information will be stored in memory and will thus be lost upon application restart.
Engine Is designed to be submitted to an Executor or ExecutorService for execution by a single
thread, and a running connector can be stopped either by calling #stop() from another thread or by interrupting
the running thread (e.g., as is the case with ExecutorService.shutdownNow()).
- Author:
- Randall Hauch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder to set up and createDebeziumEngineinstances.static interfaceInternal contract between the API and implementation, for bootstrapping the latter.static interfaceA contract invoked by the embedded engine when it has received a batch of change records to be processed.static interfaceA callback function to be notified when the connector completes.static interfaceCallback function which informs users about the various stages a connector goes through during startupstatic interfaceContract that should be passed toDebeziumEngine.RecordCommitter.markProcessed(Object, Offsets)for marking a record as processed with updated offsets.static interfaceContract passed toDebeziumEngine.ChangeConsumers, allowing them to commit single records as they have been processed and to signal that offsets may be flushed eventually. -
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T,V extends SerializationFormat<T>>
DebeziumEngine.Builder<RecordChangeEvent<T>>create(ChangeEventFormat<V> format) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances.static <S,T, K extends SerializationFormat<S>, V extends SerializationFormat<T>>
DebeziumEngine.Builder<ChangeEvent<S,T>> create(KeyValueChangeEventFormat<K, V> format) static <S,T, U, K extends SerializationFormat<S>, V extends SerializationFormat<T>, H extends SerializationFormat<U>>
DebeziumEngine.Builder<ChangeEvent<S,T>> create(KeyValueHeaderChangeEventFormat<K, V, H> format) static <K,V> DebeziumEngine.Builder<ChangeEvent<K, V>> create(Class<? extends SerializationFormat<K>> keyFormat, Class<? extends SerializationFormat<V>> valueFormat) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances.static <K,V, H> DebeziumEngine.Builder<ChangeEvent<K, V>> create(Class<? extends SerializationFormat<K>> keyFormat, Class<? extends SerializationFormat<V>> valueFormat, Class<? extends SerializationFormat<H>> headerFormat) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances.static <T> DebeziumEngine.Builder<ChangeEvent<T,T>> create(Class<? extends SerializationFormat<T>> format) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances.private static DebeziumEngine.BuilderFactory
-
Field Details
-
OFFSET_FLUSH_INTERVAL_MS_PROP
- See Also:
-
-
Method Details
-
create
static <T> DebeziumEngine.Builder<ChangeEvent<T,T>> create(Class<? extends SerializationFormat<T>> format) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances. The same format is used for key and the value of emitted change events.Convenience method, equivalent to calling
create(KeyValueChangeEventFormat.of(MyFormat.class, MyFormat.class).- Returns:
- the new builder; never null
-
create
static <K,V> DebeziumEngine.Builder<ChangeEvent<K,V>> create(Class<? extends SerializationFormat<K>> keyFormat, Class<? extends SerializationFormat<V>> valueFormat) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances. Different formats are used for key and the value of emitted change events.Convenience method, equivalent to calling
create(KeyValueChangeEventFormat.of(MyKeyFormat.class, MyValueFormat.class).- Returns:
- the new builder; never null
-
create
static <K,V, DebeziumEngine.Builder<ChangeEvent<K,H> V>> create(Class<? extends SerializationFormat<K>> keyFormat, Class<? extends SerializationFormat<V>> valueFormat, Class<? extends SerializationFormat<H>> headerFormat) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances. Different formats are used for key, value, and headers of emitted change events.Convenience method, equivalent to calling
create(KeyValueChangeEventFormat.of(MyKeyFormat.class, MyValueFormat.class, MyHeaderFormat.class).- Returns:
- the new builder; never null
-
create
static <S,T, DebeziumEngine.Builder<ChangeEvent<S,K extends SerializationFormat<S>, V extends SerializationFormat<T>> T>> create(KeyValueChangeEventFormat<K, V> format) -
create
static <S,T, DebeziumEngine.Builder<ChangeEvent<S,U, K extends SerializationFormat<S>, V extends SerializationFormat<T>, H extends SerializationFormat<U>> T>> create(KeyValueHeaderChangeEventFormat<K, V, H> format) -
create
static <T,V extends SerializationFormat<T>> DebeziumEngine.Builder<RecordChangeEvent<T>> create(ChangeEventFormat<V> format) Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances. Emitted change events encapsulate both key and value.- Returns:
- the new builder; never null
-
determineBuilderFactory
-