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| Modifier and Type | Field and Description |
|---|---|
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 |
| Modifier and Type | Method and Description |
|---|---|
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 in interface StateSnapshotpublic StateSnapshot.StateKeyGroupWriter getKeyGroupWriter()
StateSnapshotStateSnapshot.StateKeyGroupWriter and should be called in the asynchronous part of the snapshot.getKeyGroupWriter in interface StateSnapshotpublic 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 in interface StateSnapshot.StateKeyGroupWriterdov - the output.keyGroupId - the key-group to write.IOException - on write-related problems.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.