Class 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
    • 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
    • Method Detail

      • run

        public void run​(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<BEvent> ctx)
                 throws Exception
        Throws:
        Exception