Class DeltaEvictor<T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>

  • Type Parameters:
    W - The type of Windows on which this Evictor can operate.
    All Implemented Interfaces:
    Serializable, org.apache.flink.streaming.api.windowing.evictors.Evictor<T,​W>

    @PublicEvolving
    public class DeltaEvictor<T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
    extends Object
    implements org.apache.flink.streaming.api.windowing.evictors.Evictor<T,​W>
    An Evictor that keeps elements based on a DeltaFunction and a threshold.

    Eviction starts from the first element of the buffer and removes all elements from the buffer which have a higher delta then the threshold.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.windowing.evictors.Evictor

        org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void evictAfter​(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)  
      void evictBefore​(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements, int size, W window, org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)  
      static <T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
      DeltaEvictor<T,​W>
      of​(double threshold, DeltaFunction<T> deltaFunction)
      Creates a DeltaEvictor from the given threshold and DeltaFunction.
      static <T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
      DeltaEvictor<T,​W>
      of​(double threshold, DeltaFunction<T> deltaFunction, boolean doEvictAfter)
      Creates a DeltaEvictor from the given threshold, DeltaFunction.
      String toString()  
    • Method Detail

      • evictBefore

        public void evictBefore​(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements,
                                int size,
                                W window,
                                org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)
        Specified by:
        evictBefore in interface org.apache.flink.streaming.api.windowing.evictors.Evictor<T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
      • evictAfter

        public void evictAfter​(Iterable<org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>> elements,
                               int size,
                               W window,
                               org.apache.flink.streaming.api.windowing.evictors.Evictor.EvictorContext ctx)
        Specified by:
        evictAfter in interface org.apache.flink.streaming.api.windowing.evictors.Evictor<T,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
      • of

        public static <T,​W extends org.apache.flink.streaming.api.windowing.windows.Window> DeltaEvictor<T,​W> of​(double threshold,
                                                                                                                             DeltaFunction<T> deltaFunction)
        Creates a DeltaEvictor from the given threshold and DeltaFunction. Eviction is done before the window function.
        Parameters:
        threshold - The threshold
        deltaFunction - The DeltaFunction
      • of

        public static <T,​W extends org.apache.flink.streaming.api.windowing.windows.Window> DeltaEvictor<T,​W> of​(double threshold,
                                                                                                                             DeltaFunction<T> deltaFunction,
                                                                                                                             boolean doEvictAfter)
        Creates a DeltaEvictor from the given threshold, DeltaFunction. Eviction is done before/after the window function based on the value of doEvictAfter.
        Parameters:
        threshold - The threshold
        deltaFunction - The DeltaFunction
        doEvictAfter - Whether eviction should be done after window function