public class MySqlSnapshotSplitAssigner extends Object implements MySqlSplitAssigner
MySqlSplitAssigner that splits tables into small chunk splits based on primary key
range and chunk size.| Constructor and Description |
|---|
MySqlSnapshotSplitAssigner(MySqlSourceConfig sourceConfig,
int currentParallelism,
List<io.debezium.relational.TableId> remainingTables,
boolean isTableIdCaseSensitive) |
MySqlSnapshotSplitAssigner(MySqlSourceConfig sourceConfig,
int currentParallelism,
SnapshotPendingSplitsState checkpoint) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSplits(Collection<MySqlSplit> splits)
Adds a set of splits to this assigner.
|
void |
close()
Called to close the assigner, in case it holds on to any resources, like threads or network
connections.
|
Map<String,MySqlSnapshotSplit> |
getAssignedSplits() |
AssignerStatus |
getAssignerStatus()
Gets the split assigner status, see
AssignerStatus. |
List<FinishedSnapshotSplitInfo> |
getFinishedSplitInfos()
Gets the finished splits information.
|
Optional<MySqlSplit> |
getNext()
Gets the next split.
|
Map<String,BinlogOffset> |
getSplitFinishedOffsets() |
boolean |
noMoreSplits()
Indicates there is no more splits available in this assigner.
|
void |
notifyCheckpointComplete(long checkpointId)
Notifies the listener that the checkpoint with the given
checkpointId completed and
was committed. |
void |
onFinishedSplits(Map<String,BinlogOffset> splitFinishedOffsets)
Callback to handle the finished splits with finished binlog offset.
|
void |
open()
Called to open the assigner to acquire any resources, like threads or network connections.
|
SnapshotPendingSplitsState |
snapshotState(long checkpointId)
Creates a snapshot of the state of this split assigner, to be stored in a checkpoint.
|
void |
suspend()
Suspends the assigner under
AssignerStatus.INITIAL_ASSIGNING_FINISHED or AssignerStatus.NEWLY_ADDED_ASSIGNING_FINISHED. |
boolean |
waitingForFinishedSplits()
Whether the split assigner is still waiting for callback of finished splits, i.e.
|
void |
wakeup()
Wakes up the assigner under
AssignerStatus.SUSPENDED. |
public MySqlSnapshotSplitAssigner(MySqlSourceConfig sourceConfig, int currentParallelism, List<io.debezium.relational.TableId> remainingTables, boolean isTableIdCaseSensitive)
public MySqlSnapshotSplitAssigner(MySqlSourceConfig sourceConfig, int currentParallelism, SnapshotPendingSplitsState checkpoint)
public void open()
MySqlSplitAssigneropen in interface MySqlSplitAssignerpublic Optional<MySqlSplit> getNext()
MySqlSplitAssignerWhen this method returns an empty Optional, then the set of splits is assumed to
be done and the source will finish once the readers finished their current splits.
getNext in interface MySqlSplitAssignerpublic boolean waitingForFinishedSplits()
MySqlSplitAssignerMySqlSplitAssigner.onFinishedSplits(Map).waitingForFinishedSplits in interface MySqlSplitAssignerpublic List<FinishedSnapshotSplitInfo> getFinishedSplitInfos()
MySqlSplitAssignergetFinishedSplitInfos in interface MySqlSplitAssignerpublic void onFinishedSplits(Map<String,BinlogOffset> splitFinishedOffsets)
MySqlSplitAssigneronFinishedSplits in interface MySqlSplitAssignerpublic void addSplits(Collection<MySqlSplit> splits)
MySqlSplitAssigneraddSplits in interface MySqlSplitAssignerpublic SnapshotPendingSplitsState snapshotState(long checkpointId)
MySqlSplitAssignerThe snapshot should contain the latest state of the assigner: It should assume that all
operations that happened before the snapshot have successfully completed. For example all
splits assigned to readers via MySqlSplitAssigner.getNext() don't need to be included in the snapshot
anymore.
This method takes the ID of the checkpoint for which the state is snapshotted. Most implementations should be able to ignore this parameter, because for the contents of the snapshot, it doesn't matter for which checkpoint it gets created. This parameter can be interesting for source connectors with external systems where those systems are themselves aware of checkpoints; for example in cases where the enumerator notifies that system about a specific checkpoint being triggered.
snapshotState in interface MySqlSplitAssignercheckpointId - The ID of the checkpoint for which the snapshot is created.public void notifyCheckpointComplete(long checkpointId)
MySqlSplitAssignercheckpointId completed and
was committed.notifyCheckpointComplete in interface MySqlSplitAssignerCheckpointListener.notifyCheckpointComplete(long)public AssignerStatus getAssignerStatus()
MySqlSplitAssignerAssignerStatus.getAssignerStatus in interface MySqlSplitAssignerpublic void suspend()
MySqlSplitAssignerAssignerStatus.INITIAL_ASSIGNING_FINISHED or AssignerStatus.NEWLY_ADDED_ASSIGNING_FINISHED.suspend in interface MySqlSplitAssignerpublic void wakeup()
MySqlSplitAssignerAssignerStatus.SUSPENDED.wakeup in interface MySqlSplitAssignerpublic void close()
MySqlSplitAssignerclose in interface MySqlSplitAssignerpublic boolean noMoreSplits()
public Map<String,MySqlSnapshotSplit> getAssignedSplits()
public Map<String,BinlogOffset> getSplitFinishedOffsets()
Copyright © 2022 The Apache Software Foundation. All rights reserved.