You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "zoltar9264 (via GitHub)" <gi...@apache.org> on 2023/08/07 07:39:59 UTC

[GitHub] [flink] zoltar9264 commented on a diff in pull request #23146: [FLINK-32761][state/backends] Use UUID based on PhysicalStateHandleID…

zoltar9264 commented on code in PR #23146:
URL: https://github.com/apache/flink/pull/23146#discussion_r1285492407


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java:
##########
@@ -106,4 +108,12 @@ StreamStateHandle registerReference(
     void registerAllAfterRestored(CompletedCheckpoint checkpoint, RestoreMode mode);
 
     void checkpointCompleted(long checkpointId);
+
+    /** Create a unique key based on physical id. */
+    static SharedStateRegistryKey createSharedStateRegistryKey(StreamStateHandle handle) {
+        String keyString = handle.getStreamStateHandleID().getKeyString();
+        // key strings tend to be longer, so we use the MD5 of the key string to save memory
+        return new SharedStateRegistryKey(
+                UUID.nameUUIDFromBytes(keyString.getBytes(StandardCharsets.UTF_8)).toString());
+    }

Review Comment:
   Thanks for the guidance, fixed it.



-- 
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-unsubscribe@flink.apache.org

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