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

  • Type Parameters:
    K - Type of the window key.
    W - Type of the window.

    public class WindowStateStore<K,​W extends org.apache.flink.streaming.api.windowing.windows.Window>
    extends Object
    This class provides methods to store and retrieve state associated with windows in WindowContext.
    • Constructor Summary

      Constructors 
      Constructor Description
      WindowStateStore​(org.apache.flink.datastream.api.extension.window.function.WindowProcessFunction windowProcessFunction, org.apache.flink.runtime.asyncprocessing.operators.AbstractAsyncStateStreamOperator<?> operator, org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer, boolean isMergingWindow)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T,​ACC,​OUT>
      Optional<org.apache.flink.api.common.state.v2.AggregatingState<T,​OUT>>
      getWindowState​(org.apache.flink.api.common.state.AggregatingStateDeclaration<T,​ACC,​OUT> stateDeclaration, W namespace)
      Retrieve window state of AggregatingState type.
      <T> Optional<org.apache.flink.api.common.state.v2.ListState<T>> getWindowState​(org.apache.flink.api.common.state.ListStateDeclaration<T> stateDeclaration, W namespace)
      Retrieve window state of list type.
      <KEY,​V>
      Optional<org.apache.flink.api.common.state.v2.MapState<KEY,​V>>
      getWindowState​(org.apache.flink.api.common.state.MapStateDeclaration<KEY,​V> stateDeclaration, W namespace)
      Retrieve window state of map type.
      <T> Optional<org.apache.flink.api.common.state.v2.ReducingState<T>> getWindowState​(org.apache.flink.api.common.state.ReducingStateDeclaration<T> stateDeclaration, W namespace)
      Retrieve window state of ReducingState type.
      <T> Optional<org.apache.flink.api.common.state.v2.ValueState<T>> getWindowState​(org.apache.flink.api.common.state.ValueStateDeclaration<T> stateDeclaration, W namespace)
      Retrieve window state of value type.
    • Constructor Detail

      • WindowStateStore

        public WindowStateStore​(org.apache.flink.datastream.api.extension.window.function.WindowProcessFunction windowProcessFunction,
                                org.apache.flink.runtime.asyncprocessing.operators.AbstractAsyncStateStreamOperator<?> operator,
                                org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer,
                                boolean isMergingWindow)
    • Method Detail

      • getWindowState

        public <T> Optional<org.apache.flink.api.common.state.v2.ListState<T>> getWindowState​(org.apache.flink.api.common.state.ListStateDeclaration<T> stateDeclaration,
                                                                                              W namespace)
                                                                                       throws Exception
        Retrieve window state of list type.
        Throws:
        Exception
      • getWindowState

        public <KEY,​V> Optional<org.apache.flink.api.common.state.v2.MapState<KEY,​V>> getWindowState​(org.apache.flink.api.common.state.MapStateDeclaration<KEY,​V> stateDeclaration,
                                                                                                                 W namespace)
                                                                                                          throws Exception
        Retrieve window state of map type.
        Throws:
        Exception
      • getWindowState

        public <T> Optional<org.apache.flink.api.common.state.v2.ValueState<T>> getWindowState​(org.apache.flink.api.common.state.ValueStateDeclaration<T> stateDeclaration,
                                                                                               W namespace)
                                                                                        throws Exception
        Retrieve window state of value type.
        Throws:
        Exception
      • getWindowState

        public <T> Optional<org.apache.flink.api.common.state.v2.ReducingState<T>> getWindowState​(org.apache.flink.api.common.state.ReducingStateDeclaration<T> stateDeclaration,
                                                                                                  W namespace)
                                                                                           throws Exception
        Retrieve window state of ReducingState type.
        Throws:
        Exception
      • getWindowState

        public <T,​ACC,​OUT> Optional<org.apache.flink.api.common.state.v2.AggregatingState<T,​OUT>> getWindowState​(org.apache.flink.api.common.state.AggregatingStateDeclaration<T,​ACC,​OUT> stateDeclaration,
                                                                                                                                   W namespace)
                                                                                                                            throws Exception
        Retrieve window state of AggregatingState type.
        Throws:
        Exception