K - type of key.N - type of namespace.S - type of value.public class NestedStateMap<K,N,S> extends StateMap<K,N,S>
| 构造器和说明 |
|---|
NestedStateMap()
Constructs a new
NestedStateMap. |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsKey(K key,
N namespace)
Returns whether this map contains the specified key/namespace composite key.
|
S |
get(K key,
N namespace)
Returns the state for the composite of active key and given namespace.
|
java.util.stream.Stream<K> |
getKeys(N namespace) |
Map<N,Map<K,S>> |
getNamespaceMap() |
InternalKvState.StateIncrementalVisitor<K,N,S> |
getStateIncrementalVisitor(int recommendedMaxNumberOfReturnedRecords) |
Iterator<StateEntry<K,N,S>> |
iterator() |
void |
put(K key,
N namespace,
S state)
Maps the specified key/namespace composite key to the specified value.
|
S |
putAndGetOld(K key,
N namespace,
S state)
Maps the composite of active key and given namespace to the specified state.
|
void |
remove(K key,
N namespace)
Removes the mapping for the composite of active key and given namespace.
|
S |
removeAndGetOld(K key,
N namespace)
Removes the mapping for the composite of active key and given namespace, returning the state
that was found under the entry.
|
int |
size()
Returns the total number of entries in this
StateMap. |
int |
sizeOfNamespace(Object namespace) |
StateMapSnapshot<K,N,S,? extends StateMap<K,N,S>> |
stateSnapshot()
Creates a snapshot of this
StateMap, to be written in checkpointing. |
<T> void |
transform(K key,
N namespace,
T value,
StateTransformationFunction<S,T> transformation)
Applies the given
StateTransformationFunction to the state (1st input argument),
using the given value as second input argument. |
isEmpty, releaseSnapshotclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic S get(K key, N namespace)
StateMappublic boolean containsKey(K key, N namespace)
StateMapcontainsKey 在类中 StateMap<K,N,S>key - the key in the composite key to search for. Not null.namespace - the namespace in the composite key to search for. Not null.true if this map contains the specified key/namespace composite key, false otherwise.public void put(K key, N namespace, S state)
StateMap#putAndGetOld(K, N, S) (Namespace, State)} when the caller is not
interested in the old state.public S putAndGetOld(K key, N namespace, S state)
StateMapputAndGetOld 在类中 StateMap<K,N,S>key - the key. Not null.namespace - the namespace. Not null.state - the state. Can be null.null if there was
no such mapping.public void remove(K key, N namespace)
StateMap#removeAndGetOld(K, N) when the caller is not interested in the old
state.public S removeAndGetOld(K key, N namespace)
StateMapremoveAndGetOld 在类中 StateMap<K,N,S>key - the key of the mapping to remove. Not null.namespace - the namespace of the mapping to remove. Not null.null if no mapping for the specified key
was found.public <T> void transform(K key, N namespace, T value, StateTransformationFunction<S,T> transformation) throws Exception
StateMapStateTransformationFunction to the state (1st input argument),
using the given value as second input argument. The result of StateTransformationFunction.apply(Object, Object) is then stored as the new state. This
function is basically an optimization for get-update-put pattern.public Iterator<StateEntry<K,N,S>> iterator()
public InternalKvState.StateIncrementalVisitor<K,N,S> getStateIncrementalVisitor(int recommendedMaxNumberOfReturnedRecords)
getStateIncrementalVisitor 在类中 StateMap<K,N,S>public int sizeOfNamespace(Object namespace)
sizeOfNamespace 在类中 StateMap<K,N,S>@Nonnull public StateMapSnapshot<K,N,S,? extends StateMap<K,N,S>> stateSnapshot()
StateMapStateMap, to be written in checkpointing. Users should
call StateMap.releaseSnapshot(StateMapSnapshot) after using the returned object.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.