Enum ChainingStrategy

java.lang.Object
java.lang.Enum<ChainingStrategy>
org.apache.flink.streaming.api.operators.ChainingStrategy
All Implemented Interfaces:
Serializable, Comparable<ChainingStrategy>

@PublicEvolving public enum ChainingStrategy extends Enum<ChainingStrategy>
Defines the chaining scheme for the operator. When an operator is chained to the predecessor, it means that they run in the same thread. They become one operator consisting of multiple steps.

The default value used by the StreamOperator is HEAD, which means that the operator is not chained to its predecessor. Most operators override this with ALWAYS, meaning they will be chained to predecessors whenever possible.

  • Enum Constant Details

    • ALWAYS

      public static final ChainingStrategy ALWAYS
      Operators will be eagerly chained whenever possible.

      To optimize performance, it is generally a good practice to allow maximal chaining and increase operator parallelism.

    • NEVER

      public static final ChainingStrategy NEVER
      The operator will not be chained to the preceding or succeeding operators.
    • HEAD_WITH_SOURCES

      public static final ChainingStrategy HEAD_WITH_SOURCES
      This operator will run at the head of a chain (similar as in HEAD, but it will additionally try to chain source inputs if possible. This allows multi-input operators to be chained with multiple sources into one task.
  • Field Details

    • DEFAULT_CHAINING_STRATEGY

      public static final ChainingStrategy DEFAULT_CHAINING_STRATEGY
  • Method Details

    • values

      public static ChainingStrategy[] 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 ChainingStrategy 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