ayushtkn commented on code in PR #6381:
URL: https://github.com/apache/hive/pull/6381#discussion_r3018565640
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/datasource/HikariCPDataSourceProvider.java:
##########
@@ -51,6 +53,8 @@ public DataSource create(Configuration hdpConfig, int
maxPoolSize) throws SQLExc
String passwd = DataSourceProvider.getMetastoreJdbcPasswd(hdpConfig);
Properties properties =
replacePrefix(DataSourceProvider.getPrefixedProperties(hdpConfig, HIKARI));
+ // connectionTimeout is handled separately with getTimeDuration()
+ properties.remove("connectionTimeout");
Review Comment:
Can we instead handle it in the `getPrefixedProperties` itself?
```
static Properties getPrefixedProperties(Configuration hdpConfig, String
prefix, Map<String, Long> timeDurationConfigs) {
Properties props = new Properties();
Iterables.filter(hdpConfig, e -> e.getKey() != null &&
e.getKey().startsWith(prefix)).forEach(e -> {
String fullKey = e.getKey();
String keyName = fullKey.substring(prefix.length());
Long defaultVal = timeDurationConfigs.get(keyName);
if (defaultVal != null) {
long timeMs = hdpConfig.getTimeDuration(fullKey, defaultVal,
TimeUnit.MILLISECONDS);
props.setProperty(fullKey, String.valueOf(timeMs));
} else {
props.setProperty(fullKey, e.getValue());
}
});
return props;
}
```
and define a MAP like
```
private static final Map<String, Long> TIME_DURATION_CONFIGS =
Map.of("connectionTimeout",
DEFAULT_CONNECTION_TIMEOUT_MS);
```
--
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]