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 |
---|---|
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()
Optional hook to release resources for this snapshot at the end of its lifecycle.
|
void |
writeStateInKeyGroup(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 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()
release
in interface StateSnapshot
@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 void writeStateInKeyGroup(@Nonnull 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.StateKeyGroupWriter
dov
- the output.keyGroupId
- the key-group to write.IOException
- on write-related problems.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.