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 TypeSerializer<K> |
localKeySerializer
A local duplicate of the table's key serializer.
|
protected TypeSerializer<N> |
localNamespaceSerializer
A local duplicate of the table's namespace serializer.
|
protected 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 |
---|---|
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(DataOutputView dov,
int keyGroupId)
CopyOnWriteStateTable could naturally support a kind of prefix-compressed format
(grouping by namespace, writing the namespace only once per group instead for each mapping). |
protected final StateTable<K,N,S> owningStateTable
StateTable
from which this snapshot was created.@Nonnull protected final TypeSerializer<K> localKeySerializer
@Nonnull protected final TypeSerializer<N> localNamespaceSerializer
@Nonnull protected final 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()
StateSnapshot
StateSnapshot.StateKeyGroupWriter
should no longer be used after calling this method.@Nonnull public StateMetaInfoSnapshot getMetaInfoSnapshot()
StateSnapshot
getMetaInfoSnapshot
in interface StateSnapshot
public StateSnapshot.StateKeyGroupWriter getKeyGroupWriter()
StateSnapshot
StateSnapshot.StateKeyGroupWriter
and should be called in the asynchronous part
of the snapshot.getKeyGroupWriter
in interface StateSnapshot
public Iterator<StateEntry<K,N,S>> getIterator(int keyGroupId)
getIterator
in interface IterableStateSnapshot<K,N,S>
public void writeStateInKeyGroup(@Nonnull DataOutputView dov, int keyGroupId) throws IOException
CopyOnWriteStateTable
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.StateKeyGroupWriter
dov
- the output.keyGroupId
- the key-group to write.IOException
- on write-related problems.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.