Interface ChunkSplitter
-
- All Known Implementing Classes:
MySqlChunkSplitter
public interface ChunkSplitterTheChunkSplitter's task is to split table into a set of chunks or called splits (i.e.MySqlSnapshotSplit).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Called to close the splitter, in case it holds on to any resources, like threads or jdbc connections.booleanhasNextChunk()Get whether the splitter has more chunks for current table.voidnotifyCheckpointComplete(long checkpointId)Notifies the listener that the checkpoint with the givencheckpointIdcompleted and was committed.voidopen()Called to open the chunk splitter to acquire any resources, like threads or jdbc connections.ChunkSplitterStatesnapshotState(long checkpointId)Creates a snapshot of the state of this chunk splitter, to be stored in a checkpoint.List<MySqlSnapshotSplit>splitChunks(io.debezium.connector.mysql.MySqlPartition partition, io.debezium.relational.TableId tableId)Called to split chunks for a table, the assigner could invoke this method multiple times to receive all the splits.
-
-
-
Method Detail
-
open
void open()
Called to open the chunk splitter to acquire any resources, like threads or jdbc connections.
-
splitChunks
List<MySqlSnapshotSplit> splitChunks(io.debezium.connector.mysql.MySqlPartition partition, io.debezium.relational.TableId tableId) throws Exception
Called to split chunks for a table, the assigner could invoke this method multiple times to receive all the splits.- Throws:
Exception
-
hasNextChunk
boolean hasNextChunk()
Get whether the splitter has more chunks for current table.
-
snapshotState
ChunkSplitterState snapshotState(long checkpointId)
Creates a snapshot of the state of this chunk splitter, to be stored in a checkpoint.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.
- Parameters:
checkpointId- The ID of the checkpoint for which the snapshot is created.- Returns:
- an object containing the state of the split enumerator.
-
notifyCheckpointComplete
void notifyCheckpointComplete(long checkpointId)
Notifies the listener that the checkpoint with the givencheckpointIdcompleted and was committed.- See Also:
CheckpointListener.notifyCheckpointComplete(long)
-
-