Class FromElementsSourceReader<T>
- java.lang.Object
-
- org.apache.flink.connector.testframe.source.FromElementsSourceReader<T>
-
- All Implemented Interfaces:
AutoCloseable,org.apache.flink.api.common.state.CheckpointListener,org.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
public class FromElementsSourceReader<T> extends Object implements org.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
ASourceReaderimplementation that reads data from aFromElementsSource.ElementsSupplier. If limitedNum is set, the reader will stop reading at the limitedNum position until the checkpoint or savepoint triggered.
-
-
Constructor Summary
Constructors Constructor Description FromElementsSourceReader(Integer limitedNum, FromElementsSource.ElementsSupplier<T> elementsSupplier, org.apache.flink.api.connector.source.Boundedness boundedness, org.apache.flink.api.connector.source.SourceReaderContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSplits(List<FromElementsSplit> splits)voidclose()CompletableFuture<Void>isAvailable()voidnotifyCheckpointComplete(long checkpointId)voidnotifyNoMoreSplits()org.apache.flink.core.io.InputStatuspollNext(org.apache.flink.api.connector.source.ReaderOutput<T> output)List<FromElementsSplit>snapshotState(long checkpointId)voidstart()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
FromElementsSourceReader
public FromElementsSourceReader(Integer limitedNum, FromElementsSource.ElementsSupplier<T> elementsSupplier, org.apache.flink.api.connector.source.Boundedness boundedness, org.apache.flink.api.connector.source.SourceReaderContext context)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
pollNext
public org.apache.flink.core.io.InputStatus pollNext(org.apache.flink.api.connector.source.ReaderOutput<T> output) throws Exception
- Specified by:
pollNextin interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>- Throws:
Exception
-
snapshotState
public List<FromElementsSplit> snapshotState(long checkpointId)
- Specified by:
snapshotStatein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
isAvailable
public CompletableFuture<Void> isAvailable()
- Specified by:
isAvailablein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
addSplits
public void addSplits(List<FromElementsSplit> splits)
- Specified by:
addSplitsin interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
notifyNoMoreSplits
public void notifyNoMoreSplits()
- Specified by:
notifyNoMoreSplitsin interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
notifyCheckpointComplete
public void notifyCheckpointComplete(long checkpointId) throws Exception- Specified by:
notifyCheckpointCompletein interfaceorg.apache.flink.api.common.state.CheckpointListener- Specified by:
notifyCheckpointCompletein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>- Throws:
Exception
-
-