java.lang.Object
java.lang.Enum<WindowStagger>
org.apache.flink.streaming.api.windowing.assigners.WindowStagger
All Implemented Interfaces:
Serializable, Comparable<WindowStagger>

@PublicEvolving public enum WindowStagger extends Enum<WindowStagger>
A WindowStagger staggers offset in runtime for each window assignment.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Default mode, all panes fire at the same time across all partitions.
    When the first event is received in the window operator, take the difference between the start of the window and current procesing time as the offset.
    Stagger offset is sampled from uniform distribution U(0, WindowSize) when first event ingested in the partitioned operator.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract long
    getStaggerOffset(long currentProcessingTime, long size)
     
    Returns the enum constant of this type with the specified name.
    static WindowStagger[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ALIGNED

      public static final WindowStagger ALIGNED
      Default mode, all panes fire at the same time across all partitions.
    • RANDOM

      public static final WindowStagger RANDOM
      Stagger offset is sampled from uniform distribution U(0, WindowSize) when first event ingested in the partitioned operator.
    • NATURAL

      public static final WindowStagger NATURAL
      When the first event is received in the window operator, take the difference between the start of the window and current procesing time as the offset. This way, windows are staggered based on when each parallel operator receives the first event.
  • Method Details

    • values

      public static WindowStagger[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static WindowStagger valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getStaggerOffset

      public abstract long getStaggerOffset(long currentProcessingTime, long size)