@PublicEvolving public interface OperatorStateStore
Modifier and Type | Method and Description |
---|---|
<S> ListState<S> |
getListState(ListStateDescriptor<S> stateDescriptor)
Creates (or restores) a list state.
|
<S> ListState<S> |
getOperatorState(ListStateDescriptor<S> stateDescriptor)
Deprecated.
since 1.3.0. This was deprecated as part of a refinement to the function names.
Please use
getListState(ListStateDescriptor) instead. |
Set<String> |
getRegisteredStateNames()
Returns a set with the names of all currently registered states.
|
<T extends Serializable> |
getSerializableListState(String stateName)
Deprecated.
since 1.3.0. Using Java serialization for persisting state is not encouraged.
Please use
getListState(ListStateDescriptor) instead. |
<S> ListState<S> |
getUnionListState(ListStateDescriptor<S> stateDescriptor)
Creates (or restores) a list state.
|
<S> ListState<S> getListState(ListStateDescriptor<S> stateDescriptor) throws Exception
Note the semantic differences between an operator list state and a keyed list state
(see KeyedStateStore.getListState(ListStateDescriptor)
). Under the context of operator state,
the list is a collection of state items that are independent from each other and eligible for redistribution
across operator instances in case of changed operator parallelism. In other words, these state items are
the finest granularity at which non-keyed state can be redistributed, and should not be correlated with
each other.
The redistribution scheme of this list state upon operator rescaling is a round-robin pattern, such that the logical whole state (a concatenation of all the lists of state elements previously managed by each operator before the restore) is evenly divided into as many sublists as there are parallel operators.
S
- The generic type of the statestateDescriptor
- The descriptor for this state, providing a name and serializer.Exception
<S> ListState<S> getUnionListState(ListStateDescriptor<S> stateDescriptor) throws Exception
Note the semantic differences between an operator list state and a keyed list state
(see KeyedStateStore.getListState(ListStateDescriptor)
). Under the context of operator state,
the list is a collection of state items that are independent from each other and eligible for redistribution
across operator instances in case of changed operator parallelism. In other words, these state items are
the finest granularity at which non-keyed state can be redistributed, and should not be correlated with
each other.
The redistribution scheme of this list state upon operator rescaling is a broadcast pattern, such that the logical whole state (a concatenation of all the lists of state elements previously managed by each operator before the restore) is restored to all parallel operators so that each of them will get the union of all state items before the restore.
S
- The generic type of the statestateDescriptor
- The descriptor for this state, providing a name and serializer.Exception
Set<String> getRegisteredStateNames()
@Deprecated <S> ListState<S> getOperatorState(ListStateDescriptor<S> stateDescriptor) throws Exception
getListState(ListStateDescriptor)
instead.S
- The generic type of the statestateDescriptor
- The descriptor for this state, providing a name and serializer.Exception
@Deprecated <T extends Serializable> ListState<T> getSerializableListState(String stateName) throws Exception
getListState(ListStateDescriptor)
instead.This is a simple convenience method. For more flexibility on how state serialization
should happen, use the getListState(ListStateDescriptor)
method.
stateName
- The name of state to createException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.