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
ConstructorsConstructorDescriptionHeapPriorityQueueSnapshotRestoreWrapper(HeapPriorityQueueSet<T> priorityQueue, RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo, KeyExtractorFunction<T> keyExtractorFunction, KeyGroupRange localKeyGroupRange, int totalKeyGroups) -
Method Summary
Modifier and TypeMethodDescriptionforUpdatedSerializer(org.apache.flink.api.common.typeutils.TypeSerializer<T> updatedSerializer) Returns a deep copy of the snapshot, where the serializer is changed to the given serializer.forUpdatedSerializer(org.apache.flink.api.common.typeutils.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.keyGroupReader(int readVersionHint) This method returns aStateSnapshotKeyGroupReaderthat can be used to restore the state on a per-key-group basis.Returns a snapshot of the state.
-
Constructor Details
-
HeapPriorityQueueSnapshotRestoreWrapper
public HeapPriorityQueueSnapshotRestoreWrapper(@Nonnull HeapPriorityQueueSet<T> priorityQueue, @Nonnull RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo, @Nonnull KeyExtractorFunction<T> keyExtractorFunction, @Nonnull KeyGroupRange localKeyGroupRange, int totalKeyGroups)
-
-
Method Details
-
stateSnapshot
Description copied from interface:StateSnapshotRestoreReturns a snapshot of the state.- Specified by:
stateSnapshotin interfaceStateSnapshotRestore
-
keyGroupReader
Description copied from interface:StateSnapshotRestoreThis method returns aStateSnapshotKeyGroupReaderthat 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:
keyGroupReaderin 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
-
getMetaInfo
-
forUpdatedSerializer
public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer(@Nonnull org.apache.flink.api.common.typeutils.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 org.apache.flink.api.common.typeutils.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.
-