[ 
https://issues.apache.org/jira/browse/HIVE-26177?focusedWorklogId=781523&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-781523
 ]

ASF GitHub Bot logged work on HIVE-26177:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jun/22 07:50
            Start Date: 15/Jun/22 07:50
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on code in PR #3372:
URL: https://github.com/apache/hive/pull/3372#discussion_r897649788


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PersistenceManagerProvider.java:
##########
@@ -231,21 +240,24 @@ private static PersistenceManagerFactory 
initPMF(Configuration conf, boolean for
     DataSourceProvider dsp = 
DataSourceProviderFactory.tryGetDataSourceProviderOrNull(conf);
     PersistenceManagerFactory pmf;
 
+    // Any preexisting datanucleus property should be passed along
+    Map<Object, Object> dsProp = new HashMap<>(prop);
+    int maxPoolSize = -1;
+    
+    if (forCompactor) {
+      maxPoolSize = MetastoreConf.getIntVar(conf, 
ConfVars.HIVE_COMPACTOR_CONNECTION_POOLING_MAX_CONNECTIONS);
+      dsProp.put(ConfVars.CONNECTION_POOLING_MAX_CONNECTIONS.getVarname(), 
maxPoolSize);
+    }
     if (dsp == null) {
-      pmf = JDOHelper.getPersistenceManagerFactory(prop);
+      pmf = JDOHelper.getPersistenceManagerFactory(dsProp);
     } else {
       try {
-        DataSource ds =
-                forCompactor ? dsp.create(conf, MetastoreConf.getIntVar(conf, 
ConfVars.HIVE_COMPACTOR_CONNECTION_POOLING_MAX_CONNECTIONS)) :
-                        dsp.create(conf);
-        Map<Object, Object> dsProperties = new HashMap<>();
-        //Any preexisting datanucleus property should be passed along
-        dsProperties.putAll(prop);
-        dsProperties.put(PropertyNames.PROPERTY_CONNECTION_FACTORY, ds);
-        dsProperties.put(PropertyNames.PROPERTY_CONNECTION_FACTORY2, ds);
-        dsProperties.put(ConfVars.MANAGER_FACTORY_CLASS.getVarname(),
+        DataSource ds = (maxPoolSize > 0) ? dsp.create(conf, maxPoolSize) : 
dsp.create(conf);
+        dsProp.put(PropertyNames.PROPERTY_CONNECTION_FACTORY, ds);

Review Comment:
   yes, we need to pass compaction pool size instead of default datanucleus





Issue Time Tracking
-------------------

    Worklog Id:     (was: 781523)
    Time Spent: 1h 40m  (was: 1.5h)

> Create a new connection pool for compaction (DataNucleus)
> ---------------------------------------------------------
>
>                 Key: HIVE-26177
>                 URL: https://issues.apache.org/jira/browse/HIVE-26177
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Antal Sinkovits
>            Assignee: Antal Sinkovits
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to