Class MySqlHybridSplitAssigner

    • Constructor Detail

      • MySqlHybridSplitAssigner

        public MySqlHybridSplitAssigner​(MySqlSourceConfig sourceConfig,
                                        int currentParallelism,
                                        List<io.debezium.relational.TableId> remainingTables,
                                        boolean isTableIdCaseSensitive,
                                        org.apache.flink.api.connector.source.SplitEnumeratorContext<MySqlSplit> enumeratorContext)
    • Method Detail

      • open

        public void open()
        Description copied from interface: MySqlSplitAssigner
        Called to open the assigner to acquire any resources, like threads or network connections.
        Specified by:
        open in interface MySqlSplitAssigner
      • getNext

        public Optional<MySqlSplit> getNext()
        Description copied from interface: MySqlSplitAssigner
        Gets the next split.

        When 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.

        Specified by:
        getNext in interface MySqlSplitAssigner
      • onFinishedSplits

        public void onFinishedSplits​(Map<String,​BinlogOffset> splitFinishedOffsets)
        Description copied from interface: MySqlSplitAssigner
        Callback to handle the finished splits with finished binlog offset. This is useful for determine when to generate binlog split and what binlog split to generate.
        Specified by:
        onFinishedSplits in interface MySqlSplitAssigner
      • onBinlogReaderReset

        public void onBinlogReaderReset()
        Invalidates any in-flight binlog split assembly when the binlog reader resets, so a stale assembled event from the failed attempt cannot arm a release. Also runs when the split is not handed back, since a checkpoint-covered reset produces an empty add-back.
      • snapshotState

        public PendingSplitsState snapshotState​(long checkpointId)
        Description copied from interface: MySqlSplitAssigner
        Creates a snapshot of the state of this split assigner, to be stored in a checkpoint.

        The 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.

        Specified by:
        snapshotState in interface MySqlSplitAssigner
        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: MySqlSplitAssigner
        Notifies the listener that the checkpoint with the given checkpointId completed and was committed.
        Specified by:
        notifyCheckpointComplete in interface MySqlSplitAssigner
        See Also:
        CheckpointListener.notifyCheckpointComplete(long)
      • onBinlogSplitMetaAssembled

        public void onBinlogSplitMetaAssembled​(long reportedGeneration)
        Marks that the reader holds the complete binlog split, arming the metadata release. A reported generation that is neither the current one nor the inline sentinel is ignored, which drops a stale event from a reader attempt that an add-back has already superseded.
      • getBinlogAssignmentGeneration

        public long getBinlogAssignmentGeneration()
        Returns the current binlog split assignment generation.
      • isSnapshotMetaReleased

        public boolean isSnapshotMetaReleased()
        Returns whether the snapshot split metadata has been released.
      • onBinlogSplitUpdated

        public void onBinlogSplitUpdated()
        Description copied from interface: MySqlSplitAssigner
        Callback to handle the binlog split has been updated in the newly added tables process. This is useful to check the newly added tables has been finished or not.
        Specified by:
        onBinlogSplitUpdated in interface MySqlSplitAssigner