K - type of keyN - type of namespaceS - type of state@Internal public class CopyOnWriteStateTableSnapshot<K,N,S> extends Object
CopyOnWriteStateTable and has a role in operator
state checkpointing. This class is also responsible for writing the state in the process of
checkpointing.StateSnapshot.StateKeyGroupWriter| 限定符和类型 | 字段和说明 |
|---|---|
protected org.apache.flink.api.common.typeutils.TypeSerializer<K> |
localKeySerializer
A local duplicate of the table's key serializer.
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<N> |
localNamespaceSerializer
A local duplicate of the table's namespace serializer.
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<S> |
localStateSerializer
A local duplicate of the table's state serializer.
|
protected StateTable<K,N,S> |
owningStateTable
The
StateTable from which this snapshot was created. |
protected StateSnapshotTransformer<S> |
stateSnapshotTransformer |
| 限定符和类型 | 方法和说明 |
|---|---|
Iterator<StateEntry<K,N,S>> |
getIterator(int keyGroupId) |
StateSnapshot.StateKeyGroupWriter |
getKeyGroupWriter()
This method returns
StateSnapshot.StateKeyGroupWriter and should be called in the asynchronous part
of the snapshot. |
StateMetaInfoSnapshot |
getMetaInfoSnapshot()
Returns a snapshot of the state's meta data.
|
protected StateMapSnapshot<K,N,S,? extends StateMap<K,N,S>> |
getStateMapSnapshotForKeyGroup(int keyGroup)
Return the state map snapshot for the key group.
|
void |
release()
Release the snapshot.
|
void |
writeStateInKeyGroup(org.apache.flink.core.memory.DataOutputView dov,
int keyGroupId)
Implementation note: we currently chose the same format between
NestedMapsStateTable
and CopyOnWriteStateTable. |
protected final StateTable<K,N,S> owningStateTable
StateTable from which this snapshot was created.@Nonnull protected final org.apache.flink.api.common.typeutils.TypeSerializer<K> localKeySerializer
@Nonnull protected final org.apache.flink.api.common.typeutils.TypeSerializer<N> localNamespaceSerializer
@Nonnull protected final org.apache.flink.api.common.typeutils.TypeSerializer<S> localStateSerializer
@Nullable protected final StateSnapshotTransformer<S> stateSnapshotTransformer
protected StateMapSnapshot<K,N,S,? extends StateMap<K,N,S>> getStateMapSnapshotForKeyGroup(int keyGroup)
public void release()
StateSnapshotStateSnapshot.StateKeyGroupWriter should no longer be used after calling this method.@Nonnull public StateMetaInfoSnapshot getMetaInfoSnapshot()
StateSnapshotgetMetaInfoSnapshot 在接口中 StateSnapshotpublic StateSnapshot.StateKeyGroupWriter getKeyGroupWriter()
StateSnapshotStateSnapshot.StateKeyGroupWriter and should be called in the asynchronous part
of the snapshot.getKeyGroupWriter 在接口中 StateSnapshotpublic Iterator<StateEntry<K,N,S>> getIterator(int keyGroupId)
getIterator 在接口中 IterableStateSnapshot<K,N,S>public void writeStateInKeyGroup(@Nonnull org.apache.flink.core.memory.DataOutputView dov, int keyGroupId) throws IOException
NestedMapsStateTable
and CopyOnWriteStateTable.
NestedMapsStateTable could naturally support a kind of prefix-compressed format
(grouping by namespace, writing the namespace only once per group instead for each mapping).
We might implement support for different formats later (tailored towards different state
table implementations).
writeStateInKeyGroup 在接口中 StateSnapshot.StateKeyGroupWriterdov - the output.keyGroupId - the key-group to write.IOException - on write-related problems.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.