nastra commented on code in PR #6175:
URL: https://github.com/apache/iceberg/pull/6175#discussion_r1019948958
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java:
##########
@@ -87,4 +92,50 @@ public <R> R run(Action<R, IMetaStoreClient, TException>
action, boolean retry)
throws TException, InterruptedException {
return clientPool().run(action, retry);
}
+
+ @VisibleForTesting
Review Comment:
this could be simplified to:
```
@VisibleForTesting
@Value.Immutable
abstract static class Key {
abstract String metastoreUri();
abstract UserGroupInformation ugi();
static Key of(String metastoreUri) {
try {
return ImmutableKey.builder()
.metastoreUri(metastoreUri)
.ugi(UserGroupInformation.getCurrentUser())
.build();
} catch (IOException e) {
throw new UncheckedIOException("Failed to get current user", e);
}
}
}
```
You'll just need to add this compile-time dependency
```
diff --git a/build.gradle b/build.gradle
index e5ab7377b..feb2e5acc 100644
--- a/build.gradle
+++ b/build.gradle
@@ -459,6 +459,8 @@ project(':iceberg-hive-metastore') {
implementation project(':iceberg-core')
api project(':iceberg-api')
implementation project(':iceberg-common')
+ annotationProcessor "org.immutables:value"
+ compileOnly "org.immutables:value"
implementation "com.github.ben-manes.caffeine:caffeine"
```
And then you'd adjust the places where `Key` is being used to `Key.of(...`)
--
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]