flyrain commented on code in PR #5378:
URL: https://github.com/apache/iceberg/pull/5378#discussion_r933696027


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java:
##########
@@ -56,9 +57,16 @@ public class CachedClientPool implements 
ClientPool<IMetaStoreClient, TException
     init();
   }
 
+  @VisibleForTesting
+  static String cacheKey(Configuration conf) {
+    return String.format(
+        "%s:%s",
+        conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""), 
conf.get(CATALOG_DEFAULT, ""));

Review Comment:
   > Would it be "overengineering" to have a static list of config keys to use 
in the cacheKey, and use a hash, or a join of the values for the cache key?
   
   That's a good question. The use case of `metastore.catalog.default` is 
reasonable since users move data between them, so they have to be in the same 
job, and to be distinguished. I'd assume it is rare to configure 2 spark 
catalogs within **one job** for configurations like, CLIENT_SOCKET_TIMEOUT, 
HMS_HANDLER_ATTEMPTS, HMS_HANDLER_INTERVAL. But I'm open to suggestion.



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