adoroszlai commented on code in PR #5398:
URL: https://github.com/apache/ozone/pull/5398#discussion_r1348574246


##########
pom.xml:
##########
@@ -309,6 +309,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
     <jgrapht.version>1.0.1</jgrapht.version>
 
     <vault.driver.version>5.1.0</vault.driver.version>
+    <java.uuid.generator.version>3.1.4</java.uuid.generator.version>

Review Comment:
   Can you please explain how this specific version was selected?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManagerServiceGrpc.java:
##########
@@ -96,4 +99,23 @@ public void submitRequest(OMRequest request,
     }
     responseObserver.onCompleted();
   }
+
+  private static byte[] getClientId() {
+    UUID uuid = UUIDs.randomUUID();
+    ByteBuffer buf = ByteBuffer.wrap(new byte[16]);
+    buf.putLong(uuid.getMostSignificantBits());
+    buf.putLong(uuid.getLeastSignificantBits());
+    return buf.array();
+  }
+
+  private static class UUIDs {
+    private static final ThreadLocal<SecureRandom> GENERATOR =
+        ThreadLocal.withInitial(SecureRandom::new);
+
+    public static UUID randomUUID() {
+      return Generators.randomBasedGenerator(GENERATOR.get()).generate();
+    }
+
+  }

Review Comment:
   Shouldn't it be a top-level utility class in `hdds-common`?  There are quite 
a few other usages of `UUID.randomUUID()` that may benefit from this.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to