Package beamline.sources
Class StringTestSource
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.streaming.api.functions.source.RichSourceFunction<BEvent>
-
- beamline.sources.BeamlineAbstractSource
-
- beamline.sources.StringTestSource
-
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.functions.Function
,org.apache.flink.api.common.functions.RichFunction
,org.apache.flink.streaming.api.functions.source.SourceFunction<BEvent>
public class StringTestSource extends BeamlineAbstractSource
Source useful for designing new algorithm. It allows to specify sequences of events directly in the constructor.Example of usage:
StringTestSource s = new StringTestSource("ABC", "ADCE");
This is going to emit 7 events as part of 2 traces. Each trace is a string provided in the constructor and each event is one character of the string.- Author:
- Andrea Burattin
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.source.SourceFunction
org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description StringTestSource(String... traces)
Constructs the source by providing the strings representing the events to emit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<BEvent> ctx)
-
Methods inherited from class beamline.sources.BeamlineAbstractSource
cancel, isRunning
-
-
-
-
Constructor Detail
-
StringTestSource
public StringTestSource(String... traces)
Constructs the source by providing the strings representing the events to emit- Parameters:
traces
- one string for each trace, where each character is an event
-
-