Class WindowOperator.Context

    • Field Detail

      • key

        protected K key
      • window

        protected W extends Window window
    • Constructor Detail

      • Context

        public Context​(K key,
                       W window)
    • Method Detail

      • getMetricGroup

        public org.apache.flink.metrics.MetricGroup getMetricGroup()
        Description copied from interface: Trigger.TriggerContext
        Returns the metric group for this Trigger. This is the same metric group that would be returned from RuntimeContext.getMetricGroup() in a user function.

        You must not call methods that create metric objects (such as MetricGroup.counter(int) multiple times but instead call once and store the metric object in a field.

        Specified by:
        getMetricGroup in interface Trigger.TriggerContext
      • getKeyValueState

        public <S extends Serializable> org.apache.flink.api.common.state.ValueState<S> getKeyValueState​(String name,
                                                                                                         Class<S> stateType,
                                                                                                         S defaultState)
        Description copied from interface: Trigger.TriggerContext
        Retrieves a ValueState object that can be used to interact with fault-tolerant state that is scoped to the window and key of the current trigger invocation.
        Specified by:
        getKeyValueState in interface Trigger.TriggerContext
        Type Parameters:
        S - The type of the state.
        Parameters:
        name - The name of the key/value state.
        stateType - The class of the type that is stored in the state. Used to generate serializers for managed memory and checkpointing.
        defaultState - The default state value, returned when the state is accessed and no value has yet been set for the key. May be null.
        Returns:
        The partitioned state object.
      • getKeyValueState

        public <S extends Serializable> org.apache.flink.api.common.state.ValueState<S> getKeyValueState​(String name,
                                                                                                         org.apache.flink.api.common.typeinfo.TypeInformation<S> stateType,
                                                                                                         S defaultState)
        Description copied from interface: Trigger.TriggerContext
        Retrieves a ValueState object that can be used to interact with fault-tolerant state that is scoped to the window and key of the current trigger invocation.
        Specified by:
        getKeyValueState in interface Trigger.TriggerContext
        Type Parameters:
        S - The type of the state.
        Parameters:
        name - The name of the key/value state.
        stateType - The type information for the type that is stored in the state. Used to create serializers for managed memory and checkpoints.
        defaultState - The default state value, returned when the state is accessed and no value has yet been set for the key. May be null.
        Returns:
        The partitioned state object.
      • getPartitionedState

        public <S extends org.apache.flink.api.common.state.State> S getPartitionedState​(org.apache.flink.api.common.state.StateDescriptor<S,​?> stateDescriptor)
        Description copied from interface: Trigger.TriggerContext
        Retrieves a State object that can be used to interact with fault-tolerant state that is scoped to the window and key of the current trigger invocation.
        Specified by:
        getPartitionedState in interface Trigger.TriggerContext
        Type Parameters:
        S - The type of the state.
        Parameters:
        stateDescriptor - The StateDescriptor that contains the name and type of the state that is being accessed.
        Returns:
        The partitioned state object.
      • mergePartitionedState

        public <S extends org.apache.flink.api.common.state.MergingState<?,​?>> void mergePartitionedState​(org.apache.flink.api.common.state.StateDescriptor<S,​?> stateDescriptor)
        Specified by:
        mergePartitionedState in interface Trigger.OnMergeContext