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. Besides
holding the CopyOnWriteStateTable
s internal entries at the time of the snapshot, this class is also responsible for
preparing and writing the state in the process of checkpointing.
IMPORTANT: Please notice that snapshot integrity of entries in this class rely on proper copy-on-write semantics
through the CopyOnWriteStateTable
that created the snapshot object, but all objects in this snapshot must be considered
as READ-ONLY!. The reason is that the objects held by this class may or may not be deep copies of original objects
that may still used in the CopyOnWriteStateTable
. This depends for each entry on whether or not it was subject to
copy-on-write operations by the CopyOnWriteStateTable
. Phrased differently: the CopyOnWriteStateTable
provides
copy-on-write isolation for this snapshot, but this snapshot does not isolate modifications from the
CopyOnWriteStateTable
!
Modifier and Type | Class and Description |
---|---|
protected static class |
CopyOnWriteStateTableSnapshot.StateTableKeyGroupPartitioner<K,N,S>
This class is the implementation of
KeyGroupPartitioner for CopyOnWriteStateTable . |
protected static class |
CopyOnWriteStateTableSnapshot.TransformingStateTableKeyGroupPartitioner<K,N,S>
Extended state snapshot transforming
CopyOnWriteStateTableSnapshot.StateTableKeyGroupPartitioner . |
StateSnapshot.StateKeyGroupWriter
Modifier and Type | Method and Description |
---|---|
StateSnapshot.StateKeyGroupWriter |
getKeyGroupWriter()
Partitions the snapshot data by key-group.
|
StateMetaInfoSnapshot |
getMetaInfoSnapshot()
Returns a snapshot of the state's meta data.
|
void |
release()
Optional hook to release resources for this snapshot at the end of its lifecycle.
|
@Nonnull public StateSnapshot.StateKeyGroupWriter getKeyGroupWriter()
As a possible future optimization, we could perform the repartitioning in-place, using a scheme similar to the cuckoo cycles in cuckoo hashing. This can trade some performance for a smaller memory footprint.
@Nonnull public StateMetaInfoSnapshot getMetaInfoSnapshot()
StateSnapshot
public void release()
release
in interface StateSnapshot
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.