IN - The type of the values that are added to the state.ACC - The type of the accumulator (intermediate aggregation state).OUT - The type of the values that are returned from the state.@PublicEvolving public class AggregatingStateDescriptor<IN,ACC,OUT> extends StateDescriptor<AggregatingState<IN,OUT>,ACC>
AggregatingState.
The type internally stored in the state is the type of the Accumulator of the
AggregateFunction.
StateDescriptor.TypedefaultValue, name, serializer| Constructor and Description |
|---|
AggregatingStateDescriptor(String name,
AggregateFunction<IN,ACC,OUT> aggFunction,
Class<ACC> stateType)
Creates a new state descriptor with the given name, function, and type.
|
AggregatingStateDescriptor(String name,
AggregateFunction<IN,ACC,OUT> aggFunction,
TypeInformation<ACC> stateType)
Creates a new
ReducingStateDescriptor with the given name and default value. |
AggregatingStateDescriptor(String name,
AggregateFunction<IN,ACC,OUT> aggFunction,
TypeSerializer<ACC> typeSerializer)
Creates a new
ValueStateDescriptor with the given name and default value. |
| Modifier and Type | Method and Description |
|---|---|
AggregatingState<IN,OUT> |
bind(StateBinder stateBinder)
Creates a new
State on the given StateBinder. |
boolean |
equals(Object o) |
AggregateFunction<IN,ACC,OUT> |
getAggregateFunction()
Returns the aggregate function to be used for the state.
|
StateDescriptor.Type |
getType() |
int |
hashCode() |
String |
toString() |
getDefaultValue, getName, getQueryableStateName, getSerializer, initializeSerializerUnlessSet, isQueryable, isSerializerInitialized, setQueryablepublic AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, Class<ACC> stateType)
If this constructor fails (because it is not possible to describe the type via a class),
consider using the AggregatingStateDescriptor(String, AggregateFunction, TypeInformation) constructor.
name - The (unique) name for the state.aggFunction - The AggregateFunction used to aggregate the state.stateType - The type of the accumulator. The accumulator is stored in the state.public AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, TypeInformation<ACC> stateType)
ReducingStateDescriptor with the given name and default value.name - The (unique) name for the state.aggFunction - The AggregateFunction used to aggregate the state.stateType - The type of the accumulator. The accumulator is stored in the state.public AggregatingStateDescriptor(String name, AggregateFunction<IN,ACC,OUT> aggFunction, TypeSerializer<ACC> typeSerializer)
ValueStateDescriptor with the given name and default value.name - The (unique) name for the state.aggFunction - The AggregateFunction used to aggregate the state.typeSerializer - The serializer for the accumulator. The accumulator is stored in the state.public AggregatingState<IN,OUT> bind(StateBinder stateBinder) throws Exception
StateDescriptorState on the given StateBinder.bind in class StateDescriptor<AggregatingState<IN,OUT>,ACC>stateBinder - The StateBackend on which to create the State.Exceptionpublic AggregateFunction<IN,ACC,OUT> getAggregateFunction()
public StateDescriptor.Type getType()
getType in class StateDescriptor<AggregatingState<IN,OUT>,ACC>public boolean equals(Object o)
equals in class StateDescriptor<AggregatingState<IN,OUT>,ACC>public int hashCode()
hashCode in class StateDescriptor<AggregatingState<IN,OUT>,ACC>public String toString()
toString in class StateDescriptor<AggregatingState<IN,OUT>,ACC>Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.