Class StateDeclarations
- java.lang.Object
-
- org.apache.flink.api.common.state.StateDeclarations
-
@Experimental public class StateDeclarations extends Object
This is a helper class for declaring various states.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StateDeclarations.AggregatingStateDeclarationBuilder<IN,OUT,ACC>
Builder forAggregatingStateDeclaration
.static class
StateDeclarations.ListStateDeclarationBuilder<T>
Builder forListStateDeclaration
.static class
StateDeclarations.MapStateDeclarationBuilder<K,V>
Builder forMapStateDeclaration
.static class
StateDeclarations.ReducingStateDeclarationBuilder<T>
Builder forReducingStateDeclaration
.static class
StateDeclarations.ValueStateDeclarationBuilder<T>
Builder forValueStateDeclaration
.
-
Constructor Summary
Constructors Constructor Description StateDeclarations()
-
Method Summary
-
-
-
Method Detail
-
aggregatingStateBuilder
public static <IN,OUT,ACC> StateDeclarations.AggregatingStateDeclarationBuilder<IN,OUT,ACC> aggregatingStateBuilder(String name, TypeDescriptor<ACC> aggTypeDescriptor, AggregateFunction<IN,ACC,OUT> aggregateFunction)
Get the builder ofAggregatingStateDeclaration
.
-
reducingStateBuilder
public static <T> StateDeclarations.ReducingStateDeclarationBuilder<T> reducingStateBuilder(String name, TypeDescriptor<T> typeInformation, ReduceFunction<T> reduceFunction)
Get the builder ofReducingStateDeclaration
.
-
mapStateBuilder
public static <K,V> StateDeclarations.MapStateDeclarationBuilder<K,V> mapStateBuilder(String name, TypeDescriptor<K> keyTypeInformation, TypeDescriptor<V> valueTypeInformation)
Get the builder ofMapStateDeclaration
.
-
listStateBuilder
public static <T> StateDeclarations.ListStateDeclarationBuilder<T> listStateBuilder(String name, TypeDescriptor<T> elementTypeInformation)
Get the builder ofListStateDeclaration
.
-
valueStateBuilder
public <T> StateDeclarations.ValueStateDeclarationBuilder<T> valueStateBuilder(String name, TypeDescriptor<T> valueType)
Get the builder ofValueStateDeclaration
.
-
aggregatingState
public static <IN,ACC,OUT> AggregatingStateDeclaration<IN,ACC,OUT> aggregatingState(String name, TypeDescriptor<ACC> aggTypeDescriptor, AggregateFunction<IN,ACC,OUT> aggregateFunction)
Get theAggregatingStateDeclaration
of aggregating state. If you want to configure it more elaborately, useaggregatingStateBuilder(String, TypeDescriptor, AggregateFunction)
.
-
reducingState
public static <T> ReducingStateDeclaration<T> reducingState(String name, TypeDescriptor<T> typeInformation, ReduceFunction<T> reduceFunction)
Get theReducingStateDeclaration
of list state. If you want to configure it more elaborately, usereducingStateBuilder(String, TypeDescriptor, ReduceFunction)
.
-
mapState
public static <K,V> MapStateDeclaration<K,V> mapState(String name, TypeDescriptor<K> keyTypeInformation, TypeDescriptor<V> valueTypeInformation)
Get theMapStateDeclaration
of map state withStateDeclaration.RedistributionMode.NONE
. If you want to configure it more elaborately, usemapStateBuilder(String, TypeDescriptor, TypeDescriptor)
.
-
listState
public static <T> ListStateDeclaration<T> listState(String name, TypeDescriptor<T> elementTypeInformation)
Get theListStateDeclaration
of list state withStateDeclaration.RedistributionMode.NONE
. If you want to configure it more elaborately, uselistStateBuilder(String, TypeDescriptor)
.
-
valueState
public static <T> ValueStateDeclaration<T> valueState(String name, TypeDescriptor<T> valueType)
Get theValueStateDeclaration
of value state. If you want to configure it more elaborately, usevalueStateBuilder(String, TypeDescriptor)
.
-
-