Class StreamShuffler<T>

java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.api.common.functions.RichFlatMapFunction<T,​T>
de.robertmetzger.flink.utils.general.StreamShuffler<T>
Type Parameters:
T - Type in the stream
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.FlatMapFunction<T,​T>, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

public class StreamShuffler<T> extends org.apache.flink.api.common.functions.RichFlatMapFunction<T,​T>
Shuffle elements in a stream. Note: This operator does not take watermarks into account.
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Random
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StreamShuffler​(int windowSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flatMap​(T value, org.apache.flink.util.Collector<T> out)
     
    int
    getNext​(int bound)
     
    void
    open​(org.apache.flink.configuration.Configuration parameters)
     

    Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

    close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • random

      protected final Random random
  • Constructor Details

    • StreamShuffler

      public StreamShuffler(int windowSize)
  • Method Details

    • open

      public void open(org.apache.flink.configuration.Configuration parameters) throws Exception
      Specified by:
      open in interface org.apache.flink.api.common.functions.RichFunction
      Overrides:
      open in class org.apache.flink.api.common.functions.AbstractRichFunction
      Throws:
      Exception
    • flatMap

      public void flatMap(T value, org.apache.flink.util.Collector<T> out) throws Exception
      Specified by:
      flatMap in interface org.apache.flink.api.common.functions.FlatMapFunction<T,​T>
      Specified by:
      flatMap in class org.apache.flink.api.common.functions.RichFlatMapFunction<T,​T>
      Throws:
      Exception
    • getNext

      public int getNext(int bound)