nastra commented on code in PR #14700:
URL: https://github.com/apache/iceberg/pull/14700#discussion_r2567444685
##########
core/src/main/java/org/apache/iceberg/rest/RESTUtil.java:
##########
@@ -271,4 +273,25 @@ public static String resolveEndpoint(String catalogUri,
String endpointPath) {
public static Map<String, String> configHeaders(Map<String, String>
properties) {
return RESTUtil.extractPrefixMap(properties, "header.");
}
+
+ /**
+ * Generate a RFC 9562 UUIDv7 string.
+ *
+ * <p>Layout: - 48-bit Unix epoch milliseconds - 4-bit version (0b0111) -
12-bit random (rand_a) -
+ * 2-bit variant (RFC 4122, 0b10) - 62-bit random (rand_b)
+ */
+ public static String generateUuidV7() {
+ long epochMs = System.currentTimeMillis() & 0xFFFFFFFFFFFFL; // 48 bits
Review Comment:
I haven't reviewed this yet but just wanted to link how the JDK generates a
UUIDv7 in JDK26:
https://github.com/openjdk/jdk/commit/642ba4cfd18b7e17ff7f0ac3b2ce557bcaa93784
--
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]