/** * Returns a deep copy of the snapshot, where the serializer is changed to the given serializer. */ public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer( @Nonnull TypeSerializer<T> updatedSerializer) { RegisteredPriorityQueueStateBackendMetaInfo<T> updatedMetaInfo = new RegisteredPriorityQueueStateBackendMetaInfo<>(metaInfo.getName(), updatedSerializer); return new HeapPriorityQueueSnapshotRestoreWrapper<>( priorityQueue, updatedMetaInfo, keyExtractorFunction, localKeyGroupRange, totalKeyGroups); } }
/** * Returns a deep copy of the snapshot, where the serializer is changed to the given serializer. */ public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer( @Nonnull TypeSerializer<T> updatedSerializer) { RegisteredPriorityQueueStateBackendMetaInfo<T> updatedMetaInfo = new RegisteredPriorityQueueStateBackendMetaInfo<>(metaInfo.getName(), updatedSerializer); return new HeapPriorityQueueSnapshotRestoreWrapper<>( priorityQueue, updatedMetaInfo, keyExtractorFunction, localKeyGroupRange, totalKeyGroups); } }
@Nonnull private <T extends HeapPriorityQueueElement & PriorityComparable & Keyed> KeyGroupedInternalPriorityQueue<T> createInternal( RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo) { final String stateName = metaInfo.getName(); final HeapPriorityQueueSet<T> priorityQueue = priorityQueueSetFactory.create( stateName, metaInfo.getElementSerializer()); HeapPriorityQueueSnapshotRestoreWrapper<T> wrapper = new HeapPriorityQueueSnapshotRestoreWrapper<>( priorityQueue, metaInfo, KeyExtractorFunction.forKeyedObjects(), keyGroupRange, numberOfKeyGroups); registeredPQStates.put(stateName, wrapper); return priorityQueue; }
@Nonnull private <T extends HeapPriorityQueueElement & PriorityComparable & Keyed> KeyGroupedInternalPriorityQueue<T> createInternal( RegisteredPriorityQueueStateBackendMetaInfo<T> metaInfo) { final String stateName = metaInfo.getName(); final HeapPriorityQueueSet<T> priorityQueue = priorityQueueSetFactory.create( stateName, metaInfo.getElementSerializer()); HeapPriorityQueueSnapshotRestoreWrapper<T> wrapper = new HeapPriorityQueueSnapshotRestoreWrapper<>( priorityQueue, metaInfo, KeyExtractorFunction.forKeyedObjects(), keyGroupRange, numberOfKeyGroups); registeredPQStates.put(stateName, wrapper); return priorityQueue; }