Class HeapPriorityQueueSnapshotRestoreWrapper<T extends HeapPriorityQueueElement>
- java.lang.Object
-
- org.apache.flink.runtime.state.heap.HeapPriorityQueueSnapshotRestoreWrapper<T>
-
- Type Parameters:
T
- type of the queue elements.
- All Implemented Interfaces:
StateSnapshotRestore
public class HeapPriorityQueueSnapshotRestoreWrapper<T extends HeapPriorityQueueElement> extends Object implements StateSnapshotRestore
This wrapper combines a HeapPriorityQueue with backend meta data.
-
-
Constructor Summary
Constructors Constructor Description HeapPriorityQueueSnapshotRestoreWrapper(HeapPriorityQueueSet<T> priorityQueue, RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo, KeyExtractorFunction<T> keyExtractorFunction, KeyGroupRange localKeyGroupRange, int totalKeyGroups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HeapPriorityQueueSnapshotRestoreWrapper<T>
forUpdatedSerializer(TypeSerializer<T> updatedSerializer)
Returns a deep copy of the snapshot, where the serializer is changed to the given serializer.HeapPriorityQueueSnapshotRestoreWrapper<T>
forUpdatedSerializer(TypeSerializer<T> updatedSerializer, boolean allowFutureMetadataUpdates)
Returns a deep copy of the snapshot, where the serializer is re-registered by the serializer snapshot or changed to the given serializer.RegisteredPriorityQueueStateBackendMetaInfo<T>
getMetaInfo()
HeapPriorityQueueSet<T>
getPriorityQueue()
StateSnapshotKeyGroupReader
keyGroupReader(int readVersionHint)
This method returns aStateSnapshotKeyGroupReader
that can be used to restore the state on a per-key-group basis.HeapPriorityQueueStateSnapshot<T>
stateSnapshot()
Returns a snapshot of the state.
-
-
-
Constructor Detail
-
HeapPriorityQueueSnapshotRestoreWrapper
public HeapPriorityQueueSnapshotRestoreWrapper(@Nonnull HeapPriorityQueueSet<T> priorityQueue, @Nonnull RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo, @Nonnull KeyExtractorFunction<T> keyExtractorFunction, @Nonnull KeyGroupRange localKeyGroupRange, int totalKeyGroups)
-
-
Method Detail
-
stateSnapshot
@Nonnull public HeapPriorityQueueStateSnapshot<T> stateSnapshot()
Description copied from interface:StateSnapshotRestore
Returns a snapshot of the state.- Specified by:
stateSnapshot
in interfaceStateSnapshotRestore
-
keyGroupReader
@Nonnull public StateSnapshotKeyGroupReader keyGroupReader(int readVersionHint)
Description copied from interface:StateSnapshotRestore
This method returns aStateSnapshotKeyGroupReader
that can be used to restore the state on a per-key-group basis. This method tries to return a reader for the given version hint.- Specified by:
keyGroupReader
in interfaceStateSnapshotRestore
- Parameters:
readVersionHint
- the required version of the state to read.- Returns:
- a reader that reads state by key-groups, for the given read version.
-
getPriorityQueue
@Nonnull public HeapPriorityQueueSet<T> getPriorityQueue()
-
getMetaInfo
@Nonnull public RegisteredPriorityQueueStateBackendMetaInfo<T> getMetaInfo()
-
forUpdatedSerializer
public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer(@Nonnull TypeSerializer<T> updatedSerializer)
Returns a deep copy of the snapshot, where the serializer is changed to the given serializer.
-
forUpdatedSerializer
public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer(@Nonnull TypeSerializer<T> updatedSerializer, boolean allowFutureMetadataUpdates)
Returns a deep copy of the snapshot, where the serializer is re-registered by the serializer snapshot or changed to the given serializer.- Parameters:
updatedSerializer
- updated serializer.allowFutureMetadataUpdates
- whether allow metadata to update in the future or not.- Returns:
- the queue with the specified unique name.
-
-