Myasuka commented on a change in pull request #17203:
URL: https://github.com/apache/flink/pull/17203#discussion_r709721022



##########
File path: 
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/restore/ChangelogBackendRestoreOperation.java
##########
@@ -80,14 +89,19 @@
             ChangelogKeyedStateBackend<?> backend,
             ChangelogStateBackendHandle backendHandle,
             StateChangelogHandleReader<T> changelogHandleReader,
-            ClassLoader classLoader)
+            ClassLoader classLoader,
+            Map<UUID, Map<Short, StateID>> metadataByBackend)
             throws Exception {
         for (ChangelogStateHandle changelogHandle :
                 backendHandle.getNonMaterializedStateHandles()) {
+            Map<Short, StateID> stateIds =
+                    metadataByBackend.computeIfAbsent(
+                            backendHandle.getBackendID(), ign -> new 
HashMap<>());

Review comment:
       To answer the question that whether to add a unit test, I checked all 
tests under `flink-statatebackend-changelog` module, and found that the 
`stateIds` here is always empty. This could be explained that we would not 
restore two state handles from previous same statebackend, and the statd-ids 
are updated during `applyOperation`.
   If so, do we still need the API of `getBackendUID`?




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to