Interface DebeziumEngine<R>
-
- All Superinterfaces:
AutoCloseable,Closeable,Runnable
@Incubating public interface DebeziumEngine<R> extends Runnable, Closeable
A mechanism for running a single Kafka ConnectSourceConnectorwithin 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 aconsumer functionto 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
ExecutororExecutorServicefor 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 withExecutorService.shutdownNow()).- Author:
- Randall Hauch
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDebeziumEngine.Builder<R>A builder to set up and createDebeziumEngineinstances.static interfaceDebeziumEngine.BuilderFactoryInternal contract between the API and implementation, for bootstrapping the latter.static interfaceDebeziumEngine.ChangeConsumer<R>A contract invoked by the embedded engine when it has received a batch of change records to be processed.static interfaceDebeziumEngine.CompletionCallbackA callback function to be notified when the connector completes.static interfaceDebeziumEngine.ConnectorCallbackCallback function which informs users about the various stages a connector goes through during startupstatic interfaceDebeziumEngine.OffsetsContract that should be passed toDebeziumEngine.RecordCommitter.markProcessed(Object, Offsets)for marking a record as processed with updated offsets.static interfaceDebeziumEngine.RecordCommitter<R>Contract 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 Modifier and Type Field Description static StringOFFSET_FLUSH_INTERVAL_MS_PROP
-
Method Summary
Static Methods Modifier and Type Method Description 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.static <S,T,K extends SerializationFormat<S>,V extends SerializationFormat<T>>
DebeziumEngine.Builder<ChangeEvent<S,T>>create(KeyValueChangeEventFormat<K,V> 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 <T> DebeziumEngine.Builder<ChangeEvent<T,T>>create(Class<? extends SerializationFormat<T>> format)Obtain a newDebeziumEngine.Builderinstance that can be used to construct runnableDebeziumEngineinstances.
-
-
-
Field Detail
-
OFFSET_FLUSH_INTERVAL_MS_PROP
static final String OFFSET_FLUSH_INTERVAL_MS_PROP
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 <S,T,K extends SerializationFormat<S>,V extends SerializationFormat<T>> DebeziumEngine.Builder<ChangeEvent<S,T>> create(KeyValueChangeEventFormat<K,V> 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
-
-