You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/30 11:44:18 UTC
[doris] 07/15: [fix](jdbc catalog) Use default value if the user does not set the pool parameter in be.conf #18919
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 32cd764ae03f7fc57d299f9f0069690cb28aa0bd
Author: Tiewei Fang <43...@users.noreply.github.com>
AuthorDate: Sat Apr 22 08:39:26 2023 +0800
[fix](jdbc catalog) Use default value if the user does not set the pool parameter in be.conf #18919
---
.../main/java/org/apache/doris/udf/JdbcExecutor.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
index 9a6a2b9535..49d0abcdbf 100644
--- a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
+++ b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
@@ -72,10 +72,10 @@ public class JdbcExecutor {
private int curBlockRows = 0;
private static final byte[] emptyBytes = new byte[0];
private DruidDataSource druidDataSource = null;
- private int minPoolSize = 1;
- private int maxPoolSize = 100;
- private int minIdleSize = 1;
- private int maxIdelTime = 600000;
+ private int minPoolSize;
+ private int maxPoolSize;
+ private int minIdleSize;
+ private int maxIdelTime;
public JdbcExecutor(byte[] thriftParams) throws Exception {
TJdbcExecutorCtorParams request = new TJdbcExecutorCtorParams();
@@ -85,10 +85,14 @@ public class JdbcExecutor {
} catch (TException e) {
throw new InternalException(e.getMessage());
}
- minPoolSize = Integer.valueOf(System.getProperty("JDBC_MIN_POOL"));
- maxPoolSize = Integer.valueOf(System.getProperty("JDBC_MAX_POOL"));
- maxIdelTime = Integer.valueOf(System.getProperty("JDBC_MAX_IDEL_TIME"));
+ minPoolSize = Integer.valueOf(System.getProperty("JDBC_MIN_POOL", "1"));
+ maxPoolSize = Integer.valueOf(System.getProperty("JDBC_MAX_POOL", "100"));
+ maxIdelTime = Integer.valueOf(System.getProperty("JDBC_MAX_IDEL_TIME", "600000"));
minIdleSize = minPoolSize > 0 ? 1 : 0;
+ LOG.info("JdbcExecutor set minPoolSize = " + minPoolSize
+ + ", maxPoolSize = " + maxPoolSize
+ + ", maxIdelTime = " + maxIdelTime
+ + ", minIdleSize = " + minIdleSize);
init(request.driver_path, request.statement, request.batch_size, request.jdbc_driver_class,
request.jdbc_url, request.jdbc_user, request.jdbc_password, request.op, request.table_type);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org