Package org.apache.flink.runtime.state
Interface StateSnapshot
-
- All Known Subinterfaces:
IterableStateSnapshot<K,N,S>
- All Known Implementing Classes:
CopyOnWriteStateTableSnapshot
,HeapPriorityQueueStateSnapshot
@Internal public interface StateSnapshot
General interface for state snapshots that should be written partitioned by key-groups. All snapshots should be released after usage. This interface outlines the asynchronous snapshot life-cycle, which typically looks as follows. In the synchronous part of a checkpoint, an instance ofStateSnapshot
is produced for a state and captures the state at this point in time. Then, in the asynchronous part of the checkpoint, the user callsgetKeyGroupWriter()
to ensure that the snapshot is partitioned into key-groups. For state that is already partitioned, this can be a NOP. The returnedStateSnapshot.StateKeyGroupWriter
can be used by the caller to write the state by key-group. As a last step, when the state is completely written, the user callsrelease()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StateSnapshot.StateKeyGroupWriter
Interface for writing a snapshot that is partitioned into key-groups.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StateSnapshot.StateKeyGroupWriter
getKeyGroupWriter()
This method returnsStateSnapshot.StateKeyGroupWriter
and should be called in the asynchronous part of the snapshot.StateMetaInfoSnapshot
getMetaInfoSnapshot()
Returns a snapshot of the state's meta data.void
release()
Release the snapshot.
-
-
-
Method Detail
-
getKeyGroupWriter
@Nonnull StateSnapshot.StateKeyGroupWriter getKeyGroupWriter()
This method returnsStateSnapshot.StateKeyGroupWriter
and should be called in the asynchronous part of the snapshot.
-
getMetaInfoSnapshot
@Nonnull StateMetaInfoSnapshot getMetaInfoSnapshot()
Returns a snapshot of the state's meta data.
-
release
void release()
Release the snapshot. All snapshots should be released when they are no longer used because some implementation can only release resources after a release. ProducedStateSnapshot.StateKeyGroupWriter
should no longer be used after calling this method.
-
-