[
https://issues.apache.org/jira/browse/HIVE-26177?focusedWorklogId=781514&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-781514
]
ASF GitHub Bot logged work on HIVE-26177:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jun/22 07:34
Start Date: 15/Jun/22 07:34
Worklog Time Spent: 10m
Work Description: pvary commented on code in PR #3372:
URL: https://github.com/apache/hive/pull/3372#discussion_r897634918
##########
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:
We are modifying the original properties. Is this ok?
Issue Time Tracking
-------------------
Worklog Id: (was: 781514)
Time Spent: 1.5h (was: 1h 20m)
> 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: 1.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)