Class KeyedStateTransformation<K,​T>

  • Type Parameters:
    K - The type of the key in the Keyed OperatorTransformation.
    T - The type of the elements in the Keyed OperatorTransformation.

    @PublicEvolving
    public class KeyedStateTransformation<K,​T>
    extends Object
    A KeyedStateTransformation represents a OneInputStateTransformation on which operator state is partitioned by key using a provided KeySelector.
    • Method Detail

      • transform

        public StateBootstrapTransformation<T> transform​(SavepointWriterOperatorFactory factory)
        Method for passing user defined operators along with the type information that will transform the OperatorTransformation.

        IMPORTANT: Any output from this operator will be discarded.

        Parameters:
        factory - A factory returning transformation logic type of the return stream
        Returns:
        An StateBootstrapTransformation that can be added to a Savepoint.
      • window

        public <W extends org.apache.flink.streaming.api.windowing.windows.Window> WindowedStateTransformation<T,​K,​W> window​(org.apache.flink.streaming.api.windowing.assigners.WindowAssigner<? super T,​W> assigner)
        Windows this transformation into a WindowedOperatorTransformation, which bootstraps state that can be restored by a WindowOperator. Elements are put into windows by a WindowAssigner. The grouping of elements is done both by key and by window.

        A Trigger can be defined to specify when windows are evaluated. However, WindowAssigners have a default Trigger that is used if a Trigger is not specified.

        Parameters:
        assigner - The WindowAssigner that assigns elements to windows.