szehon-ho commented on code in PR #6698:
URL: https://github.com/apache/iceberg/pull/6698#discussion_r1131801430


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java:
##########
@@ -53,12 +70,14 @@ public class CachedClientPool implements 
ClientPool<IMetaStoreClient, TException
             properties,
             CatalogProperties.CLIENT_POOL_CACHE_EVICTION_INTERVAL_MS,
             CatalogProperties.CLIENT_POOL_CACHE_EVICTION_INTERVAL_MS_DEFAULT);
+    this.keySuppliers =

Review Comment:
   While I like the keySupplier idea, wouldn't it be much simpler if we just 
use a static map of suppliers, like:
   
   ```
   static final Map<String, Supplier> keySuppliers = ImmutableMap.of(
      "uri", () -> {
                   try {
                     return UserGroupInformation.getCurrentUser();
                   } catch (IOException e) {
                     throw new UncheckedIOException(e);
                   }
                 }),
      "user_name" -> {
               () -> {
                   try {
                     String userName = 
UserGroupInformation.getCurrentUser().getUserName();
                     return UserNameElement.of(userName);
                   } catch (IOException e) {
                     throw new UncheckedIOException(e);
                   }
                 });
   }
   ```
   
   (as i dont see any need to generate this on the fly.)  And then here in 
CachedClientPool CTOR, we can just apply keySuppliers on the conf to make a Key 
instead?
   



-- 
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-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to