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/22 11:18:01 UTC

[doris] 13/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-2.0-alpha
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 3fceff5200392f2e343c3de10f0fa20ee151f948
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 84b2a7d893..0691189175 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
@@ -71,10 +71,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();
@@ -84,10 +84,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