ruanhang1993 commented on code in PR #3388:
URL: https://github.com/apache/flink-cdc/pull/3388#discussion_r1699957926


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/relational/connection/JdbcConnectionPools.java:
##########
@@ -83,4 +84,14 @@ public String getJdbcUrl(
         }
         return jdbcConnectionPoolFactory.getJdbcUrl(sourceConfig);
     }
+
+    public void clear() throws IOException {
+        if (instance != null) {

Review Comment:
   We will use the `instance` to invoke this method and the `instance` will not 
be null. We could delete this judgement.



##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/connection/JdbcConnectionPools.java:
##########
@@ -51,4 +52,11 @@ public HikariDataSource getOrCreateConnectionPool(
             return pools.get(poolId);
         }
     }
+
+    public synchronized void clear() throws IOException {
+        synchronized (INSTANCE.pools) {

Review Comment:
   ```suggestion
           synchronized (pools) {
   ```



##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/relational/connection/JdbcConnectionPools.java:
##########
@@ -83,4 +84,14 @@ public String getJdbcUrl(
         }
         return jdbcConnectionPoolFactory.getJdbcUrl(sourceConfig);
     }
+
+    public void clear() throws IOException {
+        if (instance != null) {
+            synchronized (instance.pools) {

Review Comment:
   ```suggestion
               synchronized (pools) {
   ```



##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/connection/JdbcConnectionPools.java:
##########
@@ -51,4 +52,11 @@ public HikariDataSource getOrCreateConnectionPool(
             return pools.get(poolId);
         }
     }
+
+    public synchronized void clear() throws IOException {

Review Comment:
   ```suggestion
       public void clear() throws IOException {
   ```



-- 
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]

Reply via email to