public class HybridSourceReader<T> extends Object implements org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>
This reader processes splits from a sequence of sources as determined by the enumerator. The
current source is provided with SwitchSourceEvent and the reader does not require upfront
knowledge of the number and order of sources. At a given point in time one underlying reader is
active.
When the underlying reader has consumed all input for a source, HybridSourceReader
sends SourceReaderFinishedEvent to the coordinator.
This reader does not make assumptions about the order in which sources are activated. When
recovering from a checkpoint it may start processing splits for a previous source, which is
indicated via SwitchSourceEvent.
| Constructor and Description |
|---|
HybridSourceReader(org.apache.flink.api.connector.source.SourceReaderContext readerContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSplits(List<HybridSourceSplit> splits) |
void |
close() |
void |
handleSourceEvents(org.apache.flink.api.connector.source.SourceEvent sourceEvent) |
CompletableFuture<Void> |
isAvailable() |
void |
notifyCheckpointAborted(long checkpointId) |
void |
notifyCheckpointComplete(long checkpointId) |
void |
notifyNoMoreSplits() |
org.apache.flink.core.io.InputStatus |
pollNext(org.apache.flink.api.connector.source.ReaderOutput output) |
List<HybridSourceSplit> |
snapshotState(long checkpointId) |
void |
start() |
public HybridSourceReader(org.apache.flink.api.connector.source.SourceReaderContext readerContext)
public void start()
start in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public org.apache.flink.core.io.InputStatus pollNext(org.apache.flink.api.connector.source.ReaderOutput output)
throws Exception
pollNext in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>Exceptionpublic List<HybridSourceSplit> snapshotState(long checkpointId)
snapshotState in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public void notifyCheckpointComplete(long checkpointId)
throws Exception
notifyCheckpointComplete in interface org.apache.flink.api.common.state.CheckpointListenernotifyCheckpointComplete in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>Exceptionpublic void notifyCheckpointAborted(long checkpointId)
throws Exception
notifyCheckpointAborted in interface org.apache.flink.api.common.state.CheckpointListenerExceptionpublic CompletableFuture<Void> isAvailable()
isAvailable in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public void addSplits(List<HybridSourceSplit> splits)
addSplits in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public void notifyNoMoreSplits()
notifyNoMoreSplits in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public void handleSourceEvents(org.apache.flink.api.connector.source.SourceEvent sourceEvent)
handleSourceEvents in interface org.apache.flink.api.connector.source.SourceReader<T,HybridSourceSplit>public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.