T - Type of the values folded int othe stateACC - Type of the value in the state@PublicEvolving public class FoldingStateDescriptor<T,ACC> extends StateDescriptor<FoldingState<T,ACC>,ACC>
StateDescriptor for FoldingState. This can be used to create partitioned
folding state.defaultValue, name, serializer| Constructor and Description |
|---|
FoldingStateDescriptor(String name,
ACC initialValue,
FoldFunction<T,ACC> foldFunction,
Class<ACC> typeClass)
Creates a new
FoldingStateDescriptor with the given name, type, and initial value. |
FoldingStateDescriptor(String name,
ACC initialValue,
FoldFunction<T,ACC> foldFunction,
TypeInformation<ACC> typeInfo)
Creates a new
FoldingStateDescriptor with the given name and default value. |
FoldingStateDescriptor(String name,
ACC initialValue,
FoldFunction<T,ACC> foldFunction,
TypeSerializer<ACC> typeSerializer)
Creates a new
ValueStateDescriptor with the given name and default value. |
| Modifier and Type | Method and Description |
|---|---|
FoldingState<T,ACC> |
bind(StateBackend stateBackend)
Creates a new
State on the given StateBackend. |
boolean |
equals(Object o) |
FoldFunction<T,ACC> |
getFoldFunction()
Returns the fold function to be used for the folding state.
|
int |
hashCode() |
String |
toString() |
getDefaultValue, getName, getSerializer, initializeSerializerUnlessSet, isSerializerInitializedpublic FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T,ACC> foldFunction, Class<ACC> typeClass)
FoldingStateDescriptor with the given name, type, and initial value.
If this constructor fails (because it is not possible to describe the type via a class),
consider using the #FoldingStateDescriptor(String, ACC, FoldFunction, TypeInformation) constructor.
name - The (unique) name for the state.initialValue - The initial value of the fold.foldFunction - The FoldFunction used to aggregate the state.typeClass - The type of the values in the state.public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T,ACC> foldFunction, TypeInformation<ACC> typeInfo)
FoldingStateDescriptor with the given name and default value.name - The (unique) name for the state.initialValue - The initial value of the fold.foldFunction - The FoldFunction used to aggregate the state.typeInfo - The type of the values in the state.public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T,ACC> foldFunction, TypeSerializer<ACC> typeSerializer)
ValueStateDescriptor with the given name and default value.name - The (unique) name for the state.initialValue - The initial value of the fold.foldFunction - The FoldFunction used to aggregate the state.typeSerializer - The type serializer of the values in the state.public FoldingState<T,ACC> bind(StateBackend stateBackend) throws Exception
StateDescriptorState on the given StateBackend.bind in class StateDescriptor<FoldingState<T,ACC>,ACC>stateBackend - The StateBackend on which to create the State.Exceptionpublic FoldFunction<T,ACC> getFoldFunction()
public boolean equals(Object o)
equals in class StateDescriptor<FoldingState<T,ACC>,ACC>public int hashCode()
hashCode in class StateDescriptor<FoldingState<T,ACC>,ACC>public String toString()
toString in class StateDescriptor<FoldingState<T,ACC>,ACC>Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.