sfc-gh-hozhang commented on code in PR #12194:
URL: https://github.com/apache/iceberg/pull/12194#discussion_r2248859282
##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -704,4 +714,12 @@ private static TableIdentifier
viewIdentFromPathVars(Map<String, String> pathVar
return TableIdentifier.of(
namespaceFromPathVars(pathVars),
RESTUtil.decodeString(pathVars.get("view")));
}
+
+ private static class ETag {
+ private static final HashFunction MURMUR3 = Hashing.murmur3_32_fixed();
+
+ public static String of(LoadTableResponse resp) {
+ return MURMUR3.hashString(resp.metadataLocation(),
StandardCharsets.UTF_8).toString();
+ }
+ }
Review Comment:
nit: I think this can move to a ETagUtility class in src if we want to use
it outside the test
##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -704,4 +714,12 @@ private static TableIdentifier
viewIdentFromPathVars(Map<String, String> pathVar
return TableIdentifier.of(
namespaceFromPathVars(pathVars),
RESTUtil.decodeString(pathVars.get("view")));
}
+
+ private static class ETag {
+ private static final HashFunction MURMUR3 = Hashing.murmur3_32_fixed();
+
+ public static String of(LoadTableResponse resp) {
+ return MURMUR3.hashString(resp.metadataLocation(),
StandardCharsets.UTF_8).toString();
+ }
Review Comment:
nit: do we need entire LoadTableResponse?
```java
public static String ofMetadataLocation(String metadataLocation) {
return MURMUR3.hashString(metadataLocation,
StandardCharsets.UTF_8).toString();
}
```
--
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]