You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/11/18 23:54:37 UTC

[GitHub] [hive] nrg4878 commented on a diff in pull request #3773: HIVE-26701: Enable metrics for connection pools used by ObjectStore i…

nrg4878 commented on code in PR #3773:
URL: https://github.com/apache/hive/pull/3773#discussion_r1026978386


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PersistenceManagerProvider.java:
##########
@@ -251,11 +277,14 @@ private static PersistenceManagerFactory initPMF(Configuration conf, boolean for
     if (dsp == null) {
       pmf = JDOHelper.getPersistenceManagerFactory(dsProp);
     } else {
-      try {
+      String sourceName = forCompactor ? "objectstore-compactor" : "objectstore";
+      try (DataSourceProvider.DataSourceNameConfigurator configurator =
+               new DataSourceProvider.DataSourceNameConfigurator(conf, sourceName)) {

Review Comment:
   so the name of the pool will be output to the metrics file as well?



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -369,11 +369,15 @@ public void setConf(Configuration conf){
 
     int maxPoolSize = MetastoreConf.getIntVar(conf, ConfVars.CONNECTION_POOLING_MAX_CONNECTIONS);
     synchronized (TxnHandler.class) {
-      if (connPool == null) {
-        connPool = setupJdbcConnectionPool(conf, maxPoolSize);
-      }
-      if (connPoolMutex == null) {
-        connPoolMutex = setupJdbcConnectionPool(conf, maxPoolSize);
+      try (DataSourceProvider.DataSourceNameConfigurator configurator =
+               new DataSourceProvider.DataSourceNameConfigurator(conf, "txn")) {

Review Comment:
   nit: should we call this txnhandler instead of txn? 



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PersistenceManagerProvider.java:
##########
@@ -251,11 +277,14 @@ private static PersistenceManagerFactory initPMF(Configuration conf, boolean for
     if (dsp == null) {
       pmf = JDOHelper.getPersistenceManagerFactory(dsProp);
     } else {
-      try {
+      String sourceName = forCompactor ? "objectstore-compactor" : "objectstore";

Review Comment:
   will the pool name be as it is here or will it be something like objectstore-compactor-pool or objectstore-pool?



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org