You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fa...@apache.org on 2024/05/09 01:46:10 UTC

(flink-connector-jdbc) 01/02: [Hotfix][Connector/JDBC] Add the validation hint-message for connection check timeout seconds

This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-connector-jdbc.git

commit 50e8d2b16c31420bad475b629b4ab0bf4218a1f1
Author: Roc Marshal <fl...@126.com>
AuthorDate: Sat Apr 20 13:54:36 2024 +0800

    [Hotfix][Connector/JDBC] Add the validation hint-message for connection check timeout seconds
---
 .../java/org/apache/flink/connector/jdbc/JdbcConnectionOptions.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/JdbcConnectionOptions.java b/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/JdbcConnectionOptions.java
index f9f7eb53..06a352db 100644
--- a/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/JdbcConnectionOptions.java
+++ b/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/JdbcConnectionOptions.java
@@ -47,7 +47,9 @@ public class JdbcConnectionOptions implements Serializable {
             @Nullable String driverName,
             int connectionCheckTimeoutSeconds,
             @Nonnull Properties properties) {
-        Preconditions.checkArgument(connectionCheckTimeoutSeconds > 0);
+        Preconditions.checkArgument(
+                connectionCheckTimeoutSeconds > 0,
+                "Connection check timeout seconds shouldn't be smaller than 1");
         this.url = Preconditions.checkNotNull(url, "jdbc url is empty");
         this.driverName = driverName;
         this.connectionCheckTimeoutSeconds = connectionCheckTimeoutSeconds;