zhongjiajie commented on code in PR #9353:
URL: https://github.com/apache/dolphinscheduler/pull/9353#discussion_r854752983
##########
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/plugin/DataSourceClientProvider.java:
##########
@@ -55,14 +63,20 @@ public Connection getConnection(DbType dbType,
ConnectionParam connectionParam)
String datasourceUniqueId =
DataSourceUtils.getDatasourceUniqueId(baseConnectionParam, dbType);
logger.info("getConnection datasourceUniqueId {}", datasourceUniqueId);
- DataSourceClient dataSourceClient =
uniqueId2dataSourceClientMap.computeIfAbsent(datasourceUniqueId, $ -> {
- Map<String, DataSourceChannel> dataSourceChannelMap =
dataSourcePluginManager.getDataSourceChannelMap();
- DataSourceChannel dataSourceChannel =
dataSourceChannelMap.get(dbType.getDescp());
- if (null == dataSourceChannel) {
- throw new RuntimeException(String.format("datasource plugin
'%s' is not found", dbType.getDescp()));
- }
- return
dataSourceChannel.createDataSourceClient(baseConnectionParam, dbType);
- });
+ DataSourceClient dataSourceClient;
+ try {
+ dataSourceClient =
uniqueId2dataSourceClientCache.get(datasourceUniqueId, () -> {
+ Map<String, DataSourceChannel> dataSourceChannelMap =
dataSourcePluginManager.getDataSourceChannelMap();
+ DataSourceChannel dataSourceChannel =
dataSourceChannelMap.get(dbType.getDescp());
+ if (null == dataSourceChannel) {
+ throw new RuntimeException(String.format("datasource
plugin '%s' is not found", dbType.getDescp()));
+ }
+ return
dataSourceChannel.createDataSourceClient(baseConnectionParam, dbType);
+ });
+ } catch (ExecutionException e) {
+ logger.error("create {} datasource client error.",
dbType.getDescp(), e);
+ return null;
Review Comment:
Should we directly throw an exception instead of return null?
##########
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/utils/Constants.java:
##########
@@ -144,6 +144,11 @@ private Constants() {
*/
public static final String KERBEROS = "kerberos";
+ /**
+ * renew_lifetime in kerberos configuration
+ */
+ public static final String KERBEROS_RENEW_LIFETIME_HOURS =
"kerberos.renew.lifetime.hours";
Review Comment:
I can not find this config in our configuration file, should we also add it
to configuration?
--
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]