public class EventDispatcher<T extends DataCollectionId> extends Object
DatabaseSchema. But based on the applying whitelist/blacklist configuration,
events may be not be dispatched at all.
This router is also in charge of emitting heartbeat messages, exposing of metrics via JMX etc.
| Modifier and Type | Class and Description |
|---|---|
private class |
EventDispatcher.BufferingSnapshotChangeRecordReceiver |
static interface |
EventDispatcher.InconsistentSchemaHandler<T extends DataCollectionId>
Reaction to an incoming change event for which schema is not found
|
private class |
EventDispatcher.SchemaChangeEventReceiver |
static interface |
EventDispatcher.SnapshotReceiver
Change record receiver used during snapshotting.
|
private class |
EventDispatcher.StreamingChangeRecordReceiver |
| Modifier and Type | Field and Description |
|---|---|
private ChangeEventCreator |
changeEventCreator |
private CommonConnectorConfig |
connectorConfig |
private boolean |
emitTombstonesOnDelete |
private DataChangeEventListener |
eventListener |
private DataCollectionFilters.DataCollectionFilter<T> |
filter |
private Heartbeat |
heartbeat |
private HistorizedDatabaseSchema<T> |
historizedSchema |
private EventDispatcher.InconsistentSchemaHandler<T> |
inconsistentSchemaHandler |
private static org.slf4j.Logger |
LOGGER |
private ChangeEventQueue<DataChangeEvent> |
queue |
private DatabaseSchema<T> |
schema |
private EventDispatcher.StreamingChangeRecordReceiver |
streamingReceiver
Change event receiver for events dispatched from a streaming change event source.
|
private TopicSelector<T> |
topicSelector |
| Constructor and Description |
|---|
EventDispatcher(CommonConnectorConfig connectorConfig,
TopicSelector<T> topicSelector,
DatabaseSchema<T> schema,
ChangeEventQueue<DataChangeEvent> queue,
DataCollectionFilters.DataCollectionFilter<T> filter,
ChangeEventCreator changeEventCreator) |
EventDispatcher(CommonConnectorConfig connectorConfig,
TopicSelector<T> topicSelector,
DatabaseSchema<T> schema,
ChangeEventQueue<DataChangeEvent> queue,
DataCollectionFilters.DataCollectionFilter<T> filter,
ChangeEventCreator changeEventCreator,
EventDispatcher.InconsistentSchemaHandler<T> inconsistentSchemaHandler) |
private static final org.slf4j.Logger LOGGER
private final TopicSelector<T extends DataCollectionId> topicSelector
private final DatabaseSchema<T extends DataCollectionId> schema
private final HistorizedDatabaseSchema<T extends DataCollectionId> historizedSchema
private final ChangeEventQueue<DataChangeEvent> queue
private final DataCollectionFilters.DataCollectionFilter<T extends DataCollectionId> filter
private final ChangeEventCreator changeEventCreator
private final Heartbeat heartbeat
private DataChangeEventListener eventListener
private final boolean emitTombstonesOnDelete
private final EventDispatcher.InconsistentSchemaHandler<T extends DataCollectionId> inconsistentSchemaHandler
private final CommonConnectorConfig connectorConfig
private final EventDispatcher.StreamingChangeRecordReceiver streamingReceiver
public EventDispatcher(CommonConnectorConfig connectorConfig, TopicSelector<T> topicSelector, DatabaseSchema<T> schema, ChangeEventQueue<DataChangeEvent> queue, DataCollectionFilters.DataCollectionFilter<T> filter, ChangeEventCreator changeEventCreator)
public EventDispatcher(CommonConnectorConfig connectorConfig, TopicSelector<T> topicSelector, DatabaseSchema<T> schema, ChangeEventQueue<DataChangeEvent> queue, DataCollectionFilters.DataCollectionFilter<T> filter, ChangeEventCreator changeEventCreator, EventDispatcher.InconsistentSchemaHandler<T> inconsistentSchemaHandler)
public void dispatchSnapshotEvent(T dataCollectionId, ChangeRecordEmitter changeRecordEmitter, EventDispatcher.SnapshotReceiver receiver) throws InterruptedException
InterruptedExceptionpublic EventDispatcher.SnapshotReceiver getSnapshotChangeEventReceiver()
public boolean dispatchDataChangeEvent(T dataCollectionId, ChangeRecordEmitter changeRecordEmitter) throws InterruptedException
DataChangeEvents. If the given data collection is included in the currently
captured set of collections, the given emitter will be invoked, so it can emit one or more events (in the common
case, one event will be emitted, but e.g. in case of PK updates, it may be a deletion and a creation event). The
receiving coordinator creates SourceRecords for all emitted events and passes them to this dispatcher's
ChangeEventCreator for converting them into data change events.true if an event was dispatched (i.e. sent to the message broker), false otherwise.InterruptedExceptionpublic Optional<DataCollectionSchema> errorOnMissingSchema(T dataCollectionId, ChangeRecordEmitter changeRecordEmitter)
public Optional<DataCollectionSchema> ignoreMissingSchema(T dataCollectionId, ChangeRecordEmitter changeRecordEmitter)
public void dispatchSchemaChangeEvent(T dataCollectionId, SchemaChangeEventEmitter schemaChangeEventEmitter) throws InterruptedException
InterruptedExceptionpublic void alwaysDispatchHeartbeatEvent(OffsetContext offset) throws InterruptedException
InterruptedExceptionpublic void dispatchHeartbeatEvent(OffsetContext offset) throws InterruptedException
InterruptedExceptionpublic boolean heartbeatsEnabled()
private void enqueueHeartbeat(org.apache.kafka.connect.source.SourceRecord record)
throws InterruptedException
InterruptedExceptionpublic void setEventListener(DataChangeEventListener eventListener)
eventListener - Copyright © 2020 JBoss by Red Hat. All rights reserved.