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>
A
SourceReader implementation that reads data from a FromElementsSource.ElementsSupplier. If limitedNum is set, the reader will stop reading at the
limitedNum position until the checkpoint or savepoint triggered.-
Constructor Summary
ConstructorsConstructorDescriptionFromElementsSourceReader(Integer limitedNum, FromElementsSource.ElementsSupplier<T> elementsSupplier, org.apache.flink.api.connector.source.Boundedness boundedness, org.apache.flink.api.connector.source.SourceReaderContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSplits(List<FromElementsSplit> splits) voidclose()voidnotifyCheckpointComplete(long checkpointId) voidorg.apache.flink.core.io.InputStatussnapshotState(long checkpointId) voidstart()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAbortedMethods inherited from interface org.apache.flink.api.connector.source.SourceReader
handleSourceEvents, pauseOrResumeSplits
-
Constructor Details
-
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 Details
-
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
- Specified by:
snapshotStatein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
isAvailable
- Specified by:
isAvailablein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit>
-
addSplits
- 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
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
notifyCheckpointComplete
- Specified by:
notifyCheckpointCompletein interfaceorg.apache.flink.api.common.state.CheckpointListener- Specified by:
notifyCheckpointCompletein interfaceorg.apache.flink.api.connector.source.SourceReader<T,FromElementsSplit> - Throws:
Exception
-