public class HybridSourceSplitEnumerator extends Object implements org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>
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.
| Constructor and Description |
|---|
HybridSourceSplitEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext<HybridSourceSplit> context,
List<org.apache.flink.connector.base.source.hybrid.HybridSource.SourceListEntry> sources,
int initialSourceIndex,
HybridSourceEnumeratorState restoredEnumeratorState) |
| Modifier and Type | Method and Description |
|---|---|
void |
addReader(int subtaskId) |
void |
addSplitsBack(List<HybridSourceSplit> splits,
int subtaskId) |
void |
close() |
void |
handleSourceEvent(int subtaskId,
org.apache.flink.api.connector.source.SourceEvent sourceEvent) |
void |
handleSplitRequest(int subtaskId,
String requesterHostname) |
void |
notifyCheckpointAborted(long checkpointId) |
void |
notifyCheckpointComplete(long checkpointId) |
HybridSourceEnumeratorState |
snapshotState(long checkpointId) |
void |
start() |
public HybridSourceSplitEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext<HybridSourceSplit> context, List<org.apache.flink.connector.base.source.hybrid.HybridSource.SourceListEntry> sources, int initialSourceIndex, HybridSourceEnumeratorState restoredEnumeratorState)
public void start()
start in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>public void handleSplitRequest(int subtaskId,
String requesterHostname)
handleSplitRequest in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>public void addSplitsBack(List<HybridSourceSplit> splits, int subtaskId)
addSplitsBack in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>public void addReader(int subtaskId)
addReader in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>public HybridSourceEnumeratorState snapshotState(long checkpointId) throws Exception
snapshotState in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>Exceptionpublic void notifyCheckpointComplete(long checkpointId)
throws Exception
notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListenernotifyCheckpointComplete in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>Exceptionpublic void notifyCheckpointAborted(long checkpointId)
throws Exception
notifyCheckpointAborted in interface org.apache.flink.api.common.state.CheckpointListenerExceptionpublic void handleSourceEvent(int subtaskId,
org.apache.flink.api.connector.source.SourceEvent sourceEvent)
handleSourceEvent in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>public void close()
throws IOException
close in interface AutoCloseableclose in interface org.apache.flink.api.connector.source.SplitEnumerator<HybridSourceSplit,HybridSourceEnumeratorState>IOExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.