Class MySqlChunkSplitter

    • Method Detail

      • open

        public void open()
        Description copied from interface: ChunkSplitter
        Called to open the chunk splitter to acquire any resources, like threads or jdbc connections.
        Specified by:
        open in interface ChunkSplitter
      • splitChunks

        public List<MySqlSnapshotSplit> splitChunks​(io.debezium.connector.mysql.MySqlPartition partition,
                                                    io.debezium.relational.TableId tableId)
                                             throws Exception
        Description copied from interface: ChunkSplitter
        Called to split chunks for a table, the assigner could invoke this method multiple times to receive all the splits.
        Specified by:
        splitChunks in interface ChunkSplitter
        Throws:
        Exception
      • hasNextChunk

        public boolean hasNextChunk()
        Description copied from interface: ChunkSplitter
        Get whether the splitter has more chunks for current table.
        Specified by:
        hasNextChunk in interface ChunkSplitter
      • snapshotState

        public ChunkSplitterState snapshotState​(long checkpointId)
        Description copied from interface: ChunkSplitter
        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.

        Specified by:
        snapshotState in interface ChunkSplitter
        Parameters:
        checkpointId - The ID of the checkpoint for which the snapshot is created.
        Returns:
        an object containing the state of the split enumerator.
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
        Description copied from interface: ChunkSplitter
        Notifies the listener that the checkpoint with the given checkpointId completed and was committed.
        Specified by:
        notifyCheckpointComplete in interface ChunkSplitter
        See Also:
        CheckpointListener.notifyCheckpointComplete(long)
      • splitEvenlySizedChunks

        @VisibleForTesting
        public List<org.apache.flink.cdc.connectors.mysql.source.assigners.ChunkRange> splitEvenlySizedChunks​(io.debezium.relational.TableId tableId,
                                                                                                              Object min,
                                                                                                              Object max,
                                                                                                              long approximateRowCnt,
                                                                                                              int chunkSize,
                                                                                                              int dynamicChunkSize)
        Split table into evenly sized chunks based on the numeric min and max value of split column, and tumble chunks in step size.
      • getCurrentSplittingTableId

        public io.debezium.relational.TableId getCurrentSplittingTableId()
      • getNextChunkId

        public Integer getNextChunkId()
      • close

        public void close()
                   throws Exception
        Description copied from interface: ChunkSplitter
        Called to close the splitter, in case it holds on to any resources, like threads or jdbc connections.
        Specified by:
        close in interface ChunkSplitter
        Throws:
        Exception