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

java.lang.Object
org.apache.flink.datastream.impl.extension.window.context.WindowStateStore<K,W>
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

    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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