@ThreadSafe public class ChangeEventSourceCoordinator extends Object
ChangeEventSources and executes them in order.| Modifier and Type | Class and Description |
|---|---|
private class |
ChangeEventSourceCoordinator.ChangeEventSourceContextImpl |
| Modifier and Type | Field and Description |
|---|---|
private ChangeEventSourceFactory |
changeEventSourceFactory |
private ChangeEventSourceMetricsFactory |
changeEventSourceMetricsFactory |
private ErrorHandler |
errorHandler |
private EventDispatcher<?> |
eventDispatcher |
private ExecutorService |
executor |
private static org.slf4j.Logger |
LOGGER |
private OffsetContext |
previousOffset |
private boolean |
running |
private DatabaseSchema<?> |
schema |
static Duration |
SHUTDOWN_WAIT_TIMEOUT
Waiting period for the polling loop to finish.
|
private SnapshotChangeEventSourceMetrics |
snapshotMetrics |
private StreamingChangeEventSourceMetrics |
streamingMetrics |
private StreamingChangeEventSource |
streamingSource |
| Constructor and Description |
|---|
ChangeEventSourceCoordinator(OffsetContext previousOffset,
ErrorHandler errorHandler,
Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType,
CommonConnectorConfig connectorConfig,
ChangeEventSourceFactory changeEventSourceFactory,
ChangeEventSourceMetricsFactory changeEventSourceMetricsFactory,
EventDispatcher<?> eventDispatcher,
DatabaseSchema<?> schema) |
| Modifier and Type | Method and Description |
|---|---|
void |
commitOffset(Map<String,?> offset) |
<T extends CdcSourceTaskContext> |
start(T taskContext,
ChangeEventQueueMetrics changeEventQueueMetrics,
EventMetadataProvider metadataProvider) |
void |
stop()
Stops this coordinator.
|
private static final org.slf4j.Logger LOGGER
public static final Duration SHUTDOWN_WAIT_TIMEOUT
private final OffsetContext previousOffset
private final ErrorHandler errorHandler
private final ChangeEventSourceFactory changeEventSourceFactory
private final ChangeEventSourceMetricsFactory changeEventSourceMetricsFactory
private final ExecutorService executor
private final EventDispatcher<?> eventDispatcher
private final DatabaseSchema<?> schema
private volatile boolean running
private volatile StreamingChangeEventSource streamingSource
private SnapshotChangeEventSourceMetrics snapshotMetrics
private StreamingChangeEventSourceMetrics streamingMetrics
public ChangeEventSourceCoordinator(OffsetContext previousOffset, ErrorHandler errorHandler, Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, ChangeEventSourceFactory changeEventSourceFactory, ChangeEventSourceMetricsFactory changeEventSourceMetricsFactory, EventDispatcher<?> eventDispatcher, DatabaseSchema<?> schema)
public <T extends CdcSourceTaskContext> void start(T taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
public void stop()
throws InterruptedException
InterruptedExceptionCopyright © 2020 JBoss by Red Hat. All rights reserved.