Class HybridSourceSplitEnumerator

java.lang.Object
org.apache.flink.connector.base.source.hybrid.HybridSourceSplitEnumerator
All Implemented Interfaces:
AutoCloseable, org.apache.flink.api.common.state.CheckpointListener, org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>, org.apache.flink.api.connector.source.SupportsBatchSnapshot

public class HybridSourceSplitEnumerator extends Object implements org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>, org.apache.flink.api.connector.source.SupportsBatchSnapshot
Wraps the actual split enumerators and facilitates source switching. Enumerators are created lazily when source switch occurs to support runtime position conversion.

This enumerator delegates to the current underlying split enumerator and transitions to the next source once all readers have indicated via SourceReaderFinishedEvent that all input was consumed.

Switching between enumerators occurs by creating the new enumerator via Source.createEnumerator(SplitEnumeratorContext). The start position can be fixed at pipeline construction time through the source or supplied at switch time through a converter function by using the end state of the previous enumerator.

During subtask recovery, splits that have been assigned since the last checkpoint will be added back by the source coordinator. These splits may originate from a previous enumerator that is no longer active. In that case HybridSourceSplitEnumerator will suspend forwarding to the current enumerator and replay the returned splits by activating the previous readers. After returned splits were processed, delegation to the current underlying enumerator resumes.