Package org.apache.flink.streaming.util
Class FiniteTestSource<T>
- java.lang.Object
-
- org.apache.flink.streaming.util.FiniteTestSource<T>
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.state.CheckpointListener,org.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>
public class FiniteTestSource<T> extends Object implements org.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>, org.apache.flink.api.common.state.CheckpointListener
A stream source that: 1) emits a list of elements without allowing checkpoints, 2) then waits for two more checkpoints to complete, 3) then re-emits the same elements before 4) waiting for another two checkpoints and 5) exiting.This class was written to test the Bulk Writers used by the StreamingFileSink.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.source.legacy.SourceFunction
org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description FiniteTestSource(Iterable<T> elements)FiniteTestSource(BooleanSupplier couldExit, long waitTimeOut, Iterable<T> elements)FiniteTestSource(BooleanSupplier couldExit, Iterable<T> elements)FiniteTestSource(T... elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidnotifyCheckpointAborted(long checkpointId)voidnotifyCheckpointComplete(long checkpointId)voidrun(org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T> ctx)
-
-
-
Constructor Detail
-
FiniteTestSource
@SafeVarargs public FiniteTestSource(T... elements)
-
FiniteTestSource
public FiniteTestSource(@Nullable BooleanSupplier couldExit, long waitTimeOut, Iterable<T> elements)
-
FiniteTestSource
public FiniteTestSource(@Nullable BooleanSupplier couldExit, Iterable<T> elements)
-
-
Method Detail
-
run
public void run(org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T> ctx) throws Exception
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>
-
notifyCheckpointComplete
public void notifyCheckpointComplete(long checkpointId) throws Exception- Specified by:
notifyCheckpointCompletein interfaceorg.apache.flink.api.common.state.CheckpointListener- Throws:
Exception
-
notifyCheckpointAborted
public void notifyCheckpointAborted(long checkpointId)
- Specified by:
notifyCheckpointAbortedin interfaceorg.apache.flink.api.common.state.CheckpointListener
-
-