Class CopyOnWriteSkipListStateMap<K,N,S>
- java.lang.Object
-
- org.apache.flink.runtime.state.heap.StateMap<K,N,S>
-
- org.apache.flink.runtime.state.heap.CopyOnWriteSkipListStateMap<K,N,S>
-
- Type Parameters:
K- type of keyN- type of namespaceS- type of state
- All Implemented Interfaces:
AutoCloseable,Iterable<org.apache.flink.runtime.state.StateEntry<K,N,S>>
public final class CopyOnWriteSkipListStateMap<K,N,S> extends org.apache.flink.runtime.state.heap.StateMap<K,N,S> implements AutoCloseable
Implementation of state map which is based on skip list with copy-on-write support. states will be serialized to bytes and stored in the space allocated with the given allocator.
-
-
Constructor Summary
Constructors Constructor Description CopyOnWriteSkipListStateMap(org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, org.apache.flink.api.common.typeutils.TypeSerializer<S> stateSerializer, Allocator spaceAllocator, int numKeysToDeleteOneTime, float logicalRemovedKeysRatio)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleancontainsKey(K key, N namespace)Sget(K key, N namespace)java.util.stream.Stream<K>getKeys(N namespace)intgetRequestCount()org.apache.flink.runtime.state.internal.InternalKvState.StateIncrementalVisitor<K,N,S>getStateIncrementalVisitor(int recommendedMaxNumberOfReturnedRecords)Iterator<org.apache.flink.runtime.state.StateEntry<K,N,S>>iterator()voidput(K key, N namespace, S state)SputAndGetOld(K key, N namespace, S state)voidreleaseSnapshot(org.apache.flink.runtime.state.heap.StateMapSnapshot<K,N,S,? extends org.apache.flink.runtime.state.heap.StateMap<K,N,S>> snapshotToRelease)voidremove(K key, N namespace)SremoveAndGetOld(K key, N namespace)intsize()intsizeOfNamespace(Object namespace)CopyOnWriteSkipListStateMapSnapshot<K,N,S>stateSnapshot()<T> voidtransform(K key, N namespace, T value, org.apache.flink.runtime.state.StateTransformationFunction<S,T> transformation)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CopyOnWriteSkipListStateMap
public CopyOnWriteSkipListStateMap(@Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer, @Nonnull org.apache.flink.api.common.typeutils.TypeSerializer<S> stateSerializer, @Nonnull Allocator spaceAllocator, int numKeysToDeleteOneTime, float logicalRemovedKeysRatio)
-
-
Method Detail
-
size
public int size()
-
getRequestCount
public int getRequestCount()
-
transform
public <T> void transform(K key, N namespace, T value, org.apache.flink.runtime.state.StateTransformationFunction<S,T> transformation) throws Exception
-
sizeOfNamespace
public int sizeOfNamespace(Object namespace)
-
getStateIncrementalVisitor
public org.apache.flink.runtime.state.internal.InternalKvState.StateIncrementalVisitor<K,N,S> getStateIncrementalVisitor(int recommendedMaxNumberOfReturnedRecords)
-
stateSnapshot
@Nonnull public CopyOnWriteSkipListStateMapSnapshot<K,N,S> stateSnapshot()
-
releaseSnapshot
public void releaseSnapshot(org.apache.flink.runtime.state.heap.StateMapSnapshot<K,N,S,? extends org.apache.flink.runtime.state.heap.StateMap<K,N,S>> snapshotToRelease)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-