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?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]