Browse Source

[fix-7671][plugin] Supports whether SQL is placed in the same session for configuration(fix-7671) (#7675) (#8002)

-Supports whether SQL is placed in the same session for configuration

Co-authored-by: mask <39329477+Narcasserun@users.noreply.github.com>
2.0.7-release
wind 2 years ago committed by GitHub
parent
commit
d6d806c3cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dolphinscheduler-common/src/main/resources/common.properties
  2. 5
      dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java
  3. 5
      dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/utils/Constants.java

3
dolphinscheduler-common/src/main/resources/common.properties

@ -75,6 +75,9 @@ datasource.encryption.enable=false
# datasource encryption salt
datasource.encryption.salt=!@#$%^&*
# Whether hive SQL is executed in the same session
support.hive.oneSession=false
# use sudo or not, if set true, executing user is tenant user and deploy user needs sudo permissions; if set false, executing user is the deploy user and doesn't need sudo permissions
sudo.enable=true

5
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JdbcDataSourceProvider.java

@ -77,8 +77,9 @@ public class JdbcDataSourceProvider {
dataSource.setUsername(properties.getUser());
dataSource.setPassword(PasswordUtils.decodePassword(properties.getPassword()));
dataSource.setMinimumIdle(1);
dataSource.setMaximumPoolSize(1);
Boolean isOneSession = PropertyUtils.getBoolean(Constants.SUPPORT_HIVE_ONE_SESSION, false);
dataSource.setMinimumIdle(isOneSession ? 1 : PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MIN_IDLE, 5));
dataSource.setMaximumPoolSize(isOneSession ? 1 : PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MAX_ACTIVE, 50));
dataSource.setConnectionTestQuery(properties.getValidationQuery());
if (properties.getProps() != null) {

5
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/utils/Constants.java

@ -118,6 +118,11 @@ public class Constants {
*/
public static final String KERBEROS = "kerberos";
/**
* support hive datasource in one session
*/
public static final String SUPPORT_HIVE_ONE_SESSION = "support.hive.oneSession";
/**
* driver
*/

Loading…
Cancel
Save