[
https://issues.apache.org/jira/browse/HIVE-26177?focusedWorklogId=781550&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-781550
]
ASF GitHub Bot logged work on HIVE-26177:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jun/22 09:13
Start Date: 15/Jun/22 09:13
Worklog Time Spent: 10m
Work Description: pvary commented on code in PR #3372:
URL: https://github.com/apache/hive/pull/3372#discussion_r897738904
##########
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:
My question was aimed the change that with the original code we had a new,
copied property set instead of modifying the original property set. It might
cause issues in other places of the code. I was trying to find out if this was
intentional
Issue Time Tracking
-------------------
Worklog Id: (was: 781550)
Time Spent: 1h 50m (was: 1h 40m)
> 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 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)