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/29 19:02:05 UTC

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

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


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/CachedClientPool.java:
##########
@@ -33,16 +33,18 @@
 
 public class CachedClientPool implements ClientPool<IMetaStoreClient, TException> {
 
+  @VisibleForTesting static final String CATALOG_DEFAULT = "metastore.catalog.default";
   private static Cache<String, HiveClientPool> clientPoolCache;
 
   private final Configuration conf;
-  private final String metastoreUri;
+  private final String clientPoolKey;
   private final int clientPoolSize;
   private final long evictionInterval;
 
   CachedClientPool(Configuration conf, Map<String, String> properties) {
     this.conf = conf;
-    this.metastoreUri = conf.get(HiveConf.ConfVars.METASTOREURIS.varname, "");
+    this.clientPoolKey =
+        conf.get(HiveConf.ConfVars.METASTOREURIS.varname, "") + conf.get(CATALOG_DEFAULT, "");

Review Comment:
   Slightly prefer to have a separate method, so its clearer where to add if there are more client settings that need to be on different pools:
   
   ```
     String cacheKey(Configuration conf) {
       return Joiner.on(":").join(
           conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""),
           conf.get(CATALOG_DEFAULT))
     }
   ```
   
   Also preferred a separator, to make debugger easier.



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