Package org.apache.flink.state.api
Class WindowSavepointReader<W extends Window>
- java.lang.Object
-
- org.apache.flink.state.api.WindowSavepointReader<W>
-
- Type Parameters:
W
- The type ofWindow
.
@PublicEvolving public class WindowSavepointReader<W extends Window> extends Object
This class provides entry points for reading keyed state written out using theWindowOperator
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,T,ACC,R>
DataStream<R>aggregate(String uid, AggregateFunction<T,ACC,R> aggregateFunction, TypeInformation<K> keyType, TypeInformation<ACC> accType, TypeInformation<R> outputType)
Reads window state generated using anAggregateFunction
.<K,T,ACC,R,OUT>
DataStream<OUT>aggregate(String uid, AggregateFunction<T,ACC,R> aggregateFunction, WindowReaderFunction<R,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<ACC> accType, TypeInformation<OUT> outputType)
Reads window state generated using anAggregateFunction
.EvictingWindowSavepointReader<W>
evictor()
Reads from a window that uses an evictor.<K,T,OUT>
DataStream<OUT>process(String uid, WindowReaderFunction<T,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<T> stateType, TypeInformation<OUT> outputType)
Reads window state generated without any preaggregation such asWindowedStream#apply
andWindowedStream#process
.<T,K>
DataStream<T>reduce(String uid, ReduceFunction<T> function, TypeInformation<K> keyType, TypeInformation<T> reduceType)
Reads window state generated using aReduceFunction
.<K,T,OUT>
DataStream<OUT>reduce(String uid, ReduceFunction<T> function, WindowReaderFunction<T,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<T> reduceType, TypeInformation<OUT> outputType)
Reads window state generated using aReduceFunction
.
-
-
-
Method Detail
-
evictor
public EvictingWindowSavepointReader<W> evictor()
Reads from a window that uses an evictor.
-
reduce
public <T,K> DataStream<T> reduce(String uid, ReduceFunction<T> function, TypeInformation<K> keyType, TypeInformation<T> reduceType) throws IOException
Reads window state generated using aReduceFunction
.- Type Parameters:
T
- The type of the reduce function.K
- The key type of the operator.- Parameters:
uid
- The uid of the operator.function
- The reduce function used to create the window.keyType
- The key type of the window.reduceType
- The type information of the reduce function.- Returns:
- A
DataStream
of objects read from keyed state. - Throws:
IOException
- If savepoint does not contain the specified uid.
-
reduce
public <K,T,OUT> DataStream<OUT> reduce(String uid, ReduceFunction<T> function, WindowReaderFunction<T,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<T> reduceType, TypeInformation<OUT> outputType) throws IOException
Reads window state generated using aReduceFunction
.- Type Parameters:
K
- The type of the key.T
- The type of the reduce function.OUT
- The output type of the reduce function.- Parameters:
uid
- The uid of the operator.function
- The reduce function used to create the window.readerFunction
- The window reader function.keyType
- The key type of the window.reduceType
- The type information of the reduce function.outputType
- The output type of the reader function.- Returns:
- A
DataStream
of objects read from keyed state. - Throws:
IOException
- If savepoint does not contain the specified uid.
-
aggregate
public <K,T,ACC,R> DataStream<R> aggregate(String uid, AggregateFunction<T,ACC,R> aggregateFunction, TypeInformation<K> keyType, TypeInformation<ACC> accType, TypeInformation<R> outputType) throws IOException
Reads window state generated using anAggregateFunction
.- Type Parameters:
K
- The type of the key.T
- The type of the values that are aggregated.ACC
- The type of the accumulator (intermediate aggregate state).R
- The type of the aggregated result.- Parameters:
uid
- The uid of the operator.aggregateFunction
- The aggregate function used to create the window.keyType
- The key type of the window.accType
- The type information of the accumulator function.outputType
- The output type of the reader function.- Returns:
- A
DataStream
of objects read from keyed state. - Throws:
IOException
- If savepoint does not contain the specified uid.
-
aggregate
public <K,T,ACC,R,OUT> DataStream<OUT> aggregate(String uid, AggregateFunction<T,ACC,R> aggregateFunction, WindowReaderFunction<R,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<ACC> accType, TypeInformation<OUT> outputType) throws IOException
Reads window state generated using anAggregateFunction
.- Type Parameters:
K
- The type of the key.T
- The type of the values that are aggregated.ACC
- The type of the accumulator (intermediate aggregate state).R
- The type of the aggregated result.OUT
- The output type of the reader function.- Parameters:
uid
- The uid of the operator.aggregateFunction
- The aggregate function used to create the window.readerFunction
- The window reader function.keyType
- The key type of the window.accType
- The type information of the accumulator function.outputType
- The output type of the reader function.- Returns:
- A
DataStream
of objects read from keyed state. - Throws:
IOException
- If savepoint does not contain the specified uid.
-
process
public <K,T,OUT> DataStream<OUT> process(String uid, WindowReaderFunction<T,OUT,K,W> readerFunction, TypeInformation<K> keyType, TypeInformation<T> stateType, TypeInformation<OUT> outputType) throws IOException
Reads window state generated without any preaggregation such asWindowedStream#apply
andWindowedStream#process
.- Type Parameters:
K
- The type of the key.T
- The type of the records stored in state.OUT
- The output type of the reader function.- Parameters:
uid
- The uid of the operator.readerFunction
- The window reader function.keyType
- The key type of the window.stateType
- The type of records stored in state.outputType
- The output type of the reader function.- Returns:
- A
DataStream
of objects read from keyed state. - Throws:
IOException
- If the savepoint does not contain the specified uid.
-
-