T
- The type of the values that can be added to the list state.@PublicEvolving public class ReducingStateDescriptor<T> extends StateDescriptor<ReducingState<T>,T>
StateDescriptor
for ReducingState
. This can be used to create partitioned
reducing state using RuntimeContext.getReducingState(ReducingStateDescriptor)
.StateDescriptor.Type
defaultValue, name
Constructor and Description |
---|
ReducingStateDescriptor(String name,
ReduceFunction<T> reduceFunction,
Class<T> typeClass)
Creates a new
ReducingStateDescriptor with the given name, type, and default value. |
ReducingStateDescriptor(String name,
ReduceFunction<T> reduceFunction,
TypeInformation<T> typeInfo)
Creates a new
ReducingStateDescriptor with the given name and default value. |
ReducingStateDescriptor(String name,
ReduceFunction<T> reduceFunction,
TypeSerializer<T> typeSerializer)
Creates a new
ValueStateDescriptor with the given name and default value. |
Modifier and Type | Method and Description |
---|---|
ReduceFunction<T> |
getReduceFunction()
Returns the reduce function to be used for the reducing state.
|
StateDescriptor.Type |
getType() |
enableTimeToLive, equals, getDefaultValue, getName, getQueryableStateName, getSerializer, getTtlConfig, hashCode, initializeSerializerUnlessSet, initializeSerializerUnlessSet, isQueryable, isSerializerInitialized, setQueryable, toString
public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, Class<T> typeClass)
ReducingStateDescriptor
with the given name, type, and default value.
If this constructor fails (because it is not possible to describe the type via a class),
consider using the ReducingStateDescriptor(String, ReduceFunction, TypeInformation)
constructor.
name
- The (unique) name for the state.reduceFunction
- The ReduceFunction
used to aggregate the state.typeClass
- The type of the values in the state.public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, TypeInformation<T> typeInfo)
ReducingStateDescriptor
with the given name and default value.name
- The (unique) name for the state.reduceFunction
- The ReduceFunction
used to aggregate the state.typeInfo
- The type of the values in the state.public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, TypeSerializer<T> typeSerializer)
ValueStateDescriptor
with the given name and default value.name
- The (unique) name for the state.reduceFunction
- The ReduceFunction
used to aggregate the state.typeSerializer
- The type serializer of the values in the state.public ReduceFunction<T> getReduceFunction()
public StateDescriptor.Type getType()
getType
in class StateDescriptor<ReducingState<T>,T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.