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 of
StateSnapshot is produced for a state and captures the state at this point in
time. Then, in the asynchronous part of the checkpoint, the user calls getKeyGroupWriter() to ensure that the snapshot is partitioned into key-groups. For state that
is already partitioned, this can be a NOP. The returned StateSnapshot.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 calls release().-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface for writing a snapshot that is partitioned into key-groups. -
Method Summary
Modifier and TypeMethodDescriptionThis method returnsStateSnapshot.StateKeyGroupWriterand should be called in the asynchronous part of the snapshot.Returns a snapshot of the state's meta data.voidrelease()Release the snapshot.
-
Method Details
-
getKeyGroupWriter
This method returnsStateSnapshot.StateKeyGroupWriterand should be called in the asynchronous part of the snapshot. -
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.StateKeyGroupWritershould no longer be used after calling this method.
-