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.ChangeRecordReceiver |
private class |
EventDispatcher.SchemaChangeEventReceiver |
| Modifier and Type | Field and Description |
|---|---|
private DataCollectionFilters.DataCollectionFilter<T> |
filter |
private HistorizedDatabaseSchema<T> |
historizedSchema |
private static org.slf4j.Logger |
LOGGER |
private ChangeEventQueue<Object> |
queue |
private DatabaseSchema<T> |
schema |
private TopicSelector<T> |
topicSelector |
| Constructor and Description |
|---|
EventDispatcher(TopicSelector<T> topicSelector,
DatabaseSchema<T> schema,
ChangeEventQueue<Object> queue,
DataCollectionFilters.DataCollectionFilter<T> filter) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatchDataChangeEvent(T dataCollectionId,
Supplier<ChangeRecordEmitter> changeRecordEmitter,
ChangeEventCreator changeEventCreator)
Dispatches one or more
DataChangeEvents. |
void |
dispatchSchemaChangeEvent(T dataCollectionId,
Supplier<SchemaChangeEventEmitter> schemaChangeEventEmitter) |
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<Object> queue
private final DataCollectionFilters.DataCollectionFilter<T extends DataCollectionId> filter
public EventDispatcher(TopicSelector<T> topicSelector, DatabaseSchema<T> schema, ChangeEventQueue<Object> queue, DataCollectionFilters.DataCollectionFilter<T> filter)
public void dispatchDataChangeEvent(T dataCollectionId, Supplier<ChangeRecordEmitter> changeRecordEmitter, ChangeEventCreator changeEventCreator) 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 the given
ChangeEventCreator for converting them into data change events.InterruptedExceptionpublic void dispatchSchemaChangeEvent(T dataCollectionId, Supplier<SchemaChangeEventEmitter> schemaChangeEventEmitter) throws InterruptedException
InterruptedExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.