You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/30 00:27:14 UTC

[GitHub] [iceberg] flyrain commented on a diff in pull request #5378: Hive: More distinctive cached client pool key to avoid conflict

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: issues-unsubscribe@iceberg.apache.org

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


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