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:
-
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
ConstructorsConstructorDescriptionFiniteTestSource(Iterable<T> elements) FiniteTestSource(BooleanSupplier couldExit, long waitTimeOut, Iterable<T> elements) FiniteTestSource(BooleanSupplier couldExit, Iterable<T> elements) FiniteTestSource(T... elements) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidnotifyCheckpointAborted(long checkpointId) voidnotifyCheckpointComplete(long checkpointId) void
-
Constructor Details
-
FiniteTestSource
-
FiniteTestSource
-
FiniteTestSource
public FiniteTestSource(@Nullable BooleanSupplier couldExit, long waitTimeOut, Iterable<T> elements) -
FiniteTestSource
-
-
Method Details
-
run
-
cancel
public void cancel()- Specified by:
cancelin interfaceorg.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>
-
notifyCheckpointComplete
- 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
-