masteryhx commented on code in PR #19679:
URL: https://github.com/apache/flink/pull/19679#discussion_r934217986


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyedStateBackend.java:
##########
@@ -163,6 +169,34 @@ KeyGroupedInternalPriorityQueue<T> create(
         return priorityQueuesManager.createOrUpdate(stateName, 
byteOrderedElementSerializer);
     }
 
+    @Override
+    public <N, SV, SEV, S extends State, IS extends S> IS upgradeKeyedState(
+            TypeSerializer<N> namespaceSerializer,
+            StateDescriptor<S, SV> stateDescriptor,
+            @Nonnull StateSnapshotTransformFactory<SEV> 
snapshotTransformFactory)
+            throws Exception {
+        IS state =
+                createInternalState(namespaceSerializer, stateDescriptor, 
snapshotTransformFactory);
+        // rebuild metaInfo which created from previous snapshot to make it 
can continue to migrate
+        registeredKVStates.computeIfPresent(
+                stateDescriptor.getName(),
+                (stateName, stateTable) -> {
+                    stateTable.setMetaInfo(
+                            new RegisteredKeyValueStateBackendMetaInfo<>(
+                                    stateTable.getMetaInfo().snapshot()));

Review Comment:
   I just added the method in the `RegisteredStateMetaInfoBase`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to