Class TaskStateChangeEventHandler
java.lang.Object
io.debezium.connector.spanner.task.TaskStateChangeEventHandler
This class processes all types of TaskStateChangeEvents (i.e. LastCommitTimestampUpdateEvent,
NewPartitionsEvent, NewSchemaEvent, PartitionStatusUpdateEvent, SyncEvent, TaskStateChangeEvent).
This class is also responsible for sending change stream partitions that are ready to be
streamed to SynchronizedPartitionManager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChangeStreamprivate final SpannerConnectorConfigprivate final Consumer<RuntimeException>private final AtomicLongprivate final Runnableprivate static final org.slf4j.Loggerprivate final PartitionFactoryprivate final SpannerEventDispatcherprivate final TaskSyncContextHolderprivate final TaskSyncPublisher -
Constructor Summary
ConstructorsConstructorDescriptionTaskStateChangeEventHandler(TaskSyncContextHolder taskSyncContextHolder, TaskSyncPublisher taskSyncPublisher, ChangeStream changeStream, PartitionFactory partitionFactory, SpannerEventDispatcher spannerEventDispatcher, Runnable finishingHandler, SpannerConnectorConfig connectorConfig, Consumer<RuntimeException> errorHandler) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckToFailOverloadedTask(TaskSyncContext taskSyncContext) private voidfailOverloadedTaskByTimer(TaskSyncContext taskSyncContext) private TaskSyncContextperformOperation(Operation... operations) private voidprocessEvent(NewPartitionsEvent newPartitionsEvent) private voidvoidprocessEvent(TaskStateChangeEvent syncEvent) private void
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
taskSyncContextHolder
-
taskSyncPublisher
-
changeStream
-
partitionFactory
-
finishingHandler
-
connectorConfig
-
spannerEventDispatcher
-
errorHandler
-
failOverloadedTaskTimer
-
-
Constructor Details
-
TaskStateChangeEventHandler
public TaskStateChangeEventHandler(TaskSyncContextHolder taskSyncContextHolder, TaskSyncPublisher taskSyncPublisher, ChangeStream changeStream, PartitionFactory partitionFactory, SpannerEventDispatcher spannerEventDispatcher, Runnable finishingHandler, SpannerConnectorConfig connectorConfig, Consumer<RuntimeException> errorHandler)
-
-
Method Details
-
processEvent
- Throws:
InterruptedException
-
processEvent
- Throws:
InterruptedException
-
processEvent
- Throws:
InterruptedException
-
processSyncEvent
- Throws:
InterruptedException
-
failOverloadedTaskByTimer
-
checkToFailOverloadedTask
-
performOperation
- Throws:
InterruptedException
-