Class HybridSplitAssigner<C extends SourceConfig>

    • Constructor Detail

      • HybridSplitAssigner

        public HybridSplitAssigner​(C sourceConfig,
                                   int currentParallelism,
                                   List<io.debezium.relational.TableId> remainingTables,
                                   boolean isTableIdCaseSensitive,
                                   DataSourceDialect<C> dialect,
                                   OffsetFactory offsetFactory,
                                   org.apache.flink.api.connector.source.SplitEnumeratorContext<? extends org.apache.flink.api.connector.source.SourceSplit> enumeratorContext)
      • HybridSplitAssigner

        public HybridSplitAssigner​(C sourceConfig,
                                   int currentParallelism,
                                   HybridPendingSplitsState checkpoint,
                                   DataSourceDialect<C> dialect,
                                   OffsetFactory offsetFactory,
                                   org.apache.flink.api.connector.source.SplitEnumeratorContext<? extends org.apache.flink.api.connector.source.SourceSplit> enumeratorContext)
    • Method Detail

      • open

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

        public Optional<SourceSplitBase> getNext()
        Description copied from interface: SplitAssigner
        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 SplitAssigner
      • onFinishedSplits

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

        public void addSplits​(Collection<SourceSplitBase> splits)
        Description copied from interface: SplitAssigner
        Adds a set of splits to this assigner. This happens for example when some split processing failed and the splits need to be re-added.
        Specified by:
        addSplits in interface SplitAssigner
      • releaseSnapshotMetadata

        public void releaseSnapshotMetadata()
        Description copied from interface: SplitAssigner
        Releases the bulk snapshot-split metadata once the reader has assembled it and a checkpoint has covered that assignment. Implementations holding no snapshot metadata keep the default no-op. Generalizes the MySQL coordinator-memory release (FLINK-39775).
        Specified by:
        releaseSnapshotMetadata in interface SplitAssigner
      • snapshotState

        public PendingSplitsState snapshotState​(long checkpointId)
        Description copied from interface: SplitAssigner
        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 SplitAssigner.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 SplitAssigner
        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: SplitAssigner
        Notifies the listener that the checkpoint with the given checkpointId completed and was committed.
        Specified by:
        notifyCheckpointComplete in interface SplitAssigner
        See Also:
        CheckpointListener.notifyCheckpointComplete(long)
      • onStreamSplitUpdated

        public void onStreamSplitUpdated()
        Description copied from interface: SplitAssigner
        Callback to handle the stream 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:
        onStreamSplitUpdated in interface SplitAssigner
      • noMoreSplits

        public boolean noMoreSplits()
        Description copied from interface: SplitAssigner
        Indicates there is no more splits available in this assigner.
        Specified by:
        noMoreSplits in interface SplitAssigner
      • createStreamSplit

        public StreamSplit createStreamSplit()