You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/22 08:15:32 UTC

[GitHub] [inlong] chestnut-c opened a new pull request, #6265: [INLONG-6264][Sort] Support TiDB

chestnut-c opened a new pull request, #6265:
URL: https://github.com/apache/inlong/pull/6265

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [INLONG-XYZ][Component] Title of the pull request
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes #6264
   
   ### Motivation
   
   Buiold TiDB Connector
   
   ### Modifications
   
   Support TiDB 
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] yunqingmoswu commented on pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on PR #6265:
URL: https://github.com/apache/inlong/pull/6265#issuecomment-1364829489

   Please handle the conflicts.


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] github-code-scanning[bot] commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002425906


##########
inlong-sort/sort-connectors/tidb/src/main/java/io/tidb/bigdata/jdbc/LoadBalancingDriver.java:
##########
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.tidb.bigdata.jdbc;
+
+import static io.tidb.bigdata.jdbc.ExceptionHelper.call;
+import static io.tidb.bigdata.jdbc.ExceptionHelper.stringify;
+import static io.tidb.bigdata.jdbc.ExceptionHelper.uncheckedCall;
+import static java.util.Objects.requireNonNull;
+
+import io.tidb.bigdata.jdbc.impl.DiscovererImpl;
+import io.tidb.bigdata.jdbc.impl.RandomShuffleUrlMapper;
+import io.tidb.bigdata.jdbc.impl.RoundRobinUrlMapper;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
+import java.util.logging.Logger;
+
+public class LoadBalancingDriver implements Driver {
+  private static final Logger logger = Logger.getLogger(LoadBalancingDriver.class.getName());
+
+  private static final String MYSQL_URL_PREFIX = "jdbc:mysql://";
+  /**
+   * The value is set by {@link System#setProperty(String, String)}
+   */
+  private static final String TIDB_URL_MAPPER = "tidb.jdbc.url-mapper";
+  /**
+   * The value is set by {@link System#setProperty(String, String)}
+   */
+  private static final String URL_PROVIDER = "url.provider";
+  /**
+   * The value is set by {@link System#setProperty(String, String)}
+   */
+  private static final String TIDB_MIN_DISCOVER_INTERVAL_KEY = "tidb.jdbc.min-discovery-interval";
+  private static final long TIDB_MIN_DISCOVER_INTERVAL = 10000;
+  /**
+   * The value is set by {@link System#setProperty(String, String)}
+   */
+  private static final String TIDB_MAX_DISCOVER_INTERVAL_KEY = "tidb.jdbc.max-discovery-interval";
+  private static final long TIDB_MAX_DISCOVER_INTERVAL = 3600000;
+  private static final String MYSQL_DRIVER_NAME;
+  private static final String NEW_MYSQL_DRIVER_NAME = "com.mysql.cj.jdbc.Driver";
+  private static final String OLD_MYSQL_DRIVER_NAME = "com.mysql.jdbc.Driver";
+
+  private static final Base64.Encoder base64Encoder = Base64.getEncoder();
+  private static final AtomicInteger threadId = new AtomicInteger();
+  private static final ThreadLocal<MessageDigest> digestThreadLocal =
+      ThreadLocal.withInitial(() -> uncheckedCall(() -> MessageDigest.getInstance("md5")));

Review Comment:
   ## Use of a broken or risky cryptographic algorithm
   
   Cryptographic algorithm [md5](1) is weak and should not be used.
   
   [Show more details](https://github.com/apache/inlong/security/code-scanning/39)



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] chestnut-c commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
chestnut-c commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002924656


##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${dep.apache.commons.version}</version>
+        </dependency>
+        <dependency>

Review Comment:
   yes Some operations are used



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] chestnut-c commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
chestnut-c commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002917596


##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${dep.apache.commons.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${dep.guava.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>

Review Comment:
   yes



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>

Review Comment:
   yes



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] chestnut-c commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
chestnut-c commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002917913


##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>

Review Comment:
   yes



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] chestnut-c commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
chestnut-c commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002923494


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/TidbExtractNode.java:
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.sort.protocol.node.extract;
+
+import com.google.common.base.Preconditions;
+import java.io.Serializable;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude.Include;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeName;
+import org.apache.inlong.common.enums.MetaField;
+import org.apache.inlong.sort.protocol.FieldInfo;
+import org.apache.inlong.sort.protocol.InlongMetric;
+import org.apache.inlong.sort.protocol.Metadata;
+import org.apache.inlong.sort.protocol.enums.ExtractMode;
+import org.apache.inlong.sort.protocol.node.ExtractNode;
+import org.apache.inlong.sort.protocol.transformation.WatermarkField;
+
+/**
+ * Tidb extract node for extract data from tidb
+ */
+@EqualsAndHashCode(callSuper = true)
+@JsonTypeName("tidbExtract")
+@Data
+public class TidbExtractNode extends ExtractNode implements Metadata, InlongMetric, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonInclude(Include.NON_NULL)
+    @JsonProperty("primaryKey")
+    private String primaryKey;
+    @JsonProperty("url")
+    private String url;
+    @JsonProperty("database")
+    private String database;
+    @JsonProperty("tableName")
+    private String tableName;
+    @JsonProperty("username")
+    private String username;
+    @JsonProperty("password")
+    private String password;
+    @JsonProperty("bootstrapServers")
+    private String bootstrapServers;
+    @JsonProperty("topic")
+    private String topic;
+    @JsonProperty("groupId")
+    private String groupId;
+    @JsonProperty("codec")
+    private String codec;
+    @JsonProperty("autoOffsetReset")
+    private String autoOffsetReset;
+
+    /**
+     * Constructor
+     *
+     * @param id The id of node
+     * @param name The name of node
+     * @param fields The field list of node
+     * @param watermarkField The watermark field of node only used for {@link ExtractMode#CDC}
+     * @param properties The properties connect to tidb
+     * @param primaryKey The primark key connect to tidb
+     * @param tableName The table name connect to tidb
+     * @param url The url connect to tidb
+     * @param database The database connect to tidb
+     * @param username The username  connect to tidb
+     * @param password The password  connect to tidb
+     * @param bootstrapServers The bootstrapServers connect to kafka
+     * @param topic The topic connect to kafka
+     * @param codec The codec is topic data of format
+     * @param groupId The kafka topic groupId
+     */
+    @JsonCreator
+    public TidbExtractNode(@Nonnull @JsonProperty("id") String id,
+            @Nonnull @JsonProperty("name") String name,
+            @Nonnull @JsonProperty("fields") List<FieldInfo> fields,
+            @Nullable @JsonProperty("watermarkField") WatermarkField watermarkField,
+            @JsonProperty("properties") Map<String, String> properties,
+            @JsonProperty("primaryKey") String primaryKey,
+            @Nullable @JsonProperty("url") String url,
+            @Nonnull @JsonProperty("tableName") String tableName,
+            @Nonnull @JsonProperty("database") String database,
+            @Nonnull @JsonProperty("username") String username,
+            @Nonnull @JsonProperty("password") String password,
+            @Nonnull @JsonProperty("bootstrapServers") String bootstrapServers,
+            @Nonnull @JsonProperty("topic") String topic,
+            @Nonnull @JsonProperty("codec") String codec,
+            @JsonProperty("groupId") String groupId,
+            @JsonProperty("autoOffsetReset") String autoOffsetReset
+    ) {
+        super(id, name, fields, watermarkField, properties);
+        this.url = Preconditions.checkNotNull(url, "url is null");
+        this.tableName = Preconditions.checkNotNull(tableName, "tableName is null");
+        this.database = Preconditions.checkNotNull(database, "database is null");
+        this.username = Preconditions.checkNotNull(username, "username is null");
+        this.password = Preconditions.checkNotNull(password, "password is null");
+        this.bootstrapServers = Preconditions.checkNotNull(bootstrapServers, "bootstrapServers is null");
+        this.topic = Preconditions.checkNotNull(topic, "topic is null");
+        this.codec = Preconditions.checkNotNull(codec, "codec is null");
+        this.groupId = groupId;
+        this.primaryKey = primaryKey;
+        this.autoOffsetReset = autoOffsetReset;
+    }
+
+    @Override
+    public String genTableName() {
+        return String.format("table_%s", super.getId());
+    }
+
+    @Override
+    public String getPrimaryKey() {
+        return primaryKey;
+    }
+
+    @Override
+    public Map<String, String> tableOptions() {
+        Map<String, String> options = super.tableOptions();
+
+        options.put("connector", "tidb");

Review Comment:
   ok i will change it



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002854041


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/TidbExtractNode.java:
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.sort.protocol.node.extract;
+
+import com.google.common.base.Preconditions;
+import java.io.Serializable;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude.Include;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonTypeName;
+import org.apache.inlong.common.enums.MetaField;
+import org.apache.inlong.sort.protocol.FieldInfo;
+import org.apache.inlong.sort.protocol.InlongMetric;
+import org.apache.inlong.sort.protocol.Metadata;
+import org.apache.inlong.sort.protocol.enums.ExtractMode;
+import org.apache.inlong.sort.protocol.node.ExtractNode;
+import org.apache.inlong.sort.protocol.transformation.WatermarkField;
+
+/**
+ * Tidb extract node for extract data from tidb
+ */
+@EqualsAndHashCode(callSuper = true)
+@JsonTypeName("tidbExtract")
+@Data
+public class TidbExtractNode extends ExtractNode implements Metadata, InlongMetric, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonInclude(Include.NON_NULL)
+    @JsonProperty("primaryKey")
+    private String primaryKey;
+    @JsonProperty("url")
+    private String url;
+    @JsonProperty("database")
+    private String database;
+    @JsonProperty("tableName")
+    private String tableName;
+    @JsonProperty("username")
+    private String username;
+    @JsonProperty("password")
+    private String password;
+    @JsonProperty("bootstrapServers")
+    private String bootstrapServers;
+    @JsonProperty("topic")
+    private String topic;
+    @JsonProperty("groupId")
+    private String groupId;
+    @JsonProperty("codec")
+    private String codec;
+    @JsonProperty("autoOffsetReset")
+    private String autoOffsetReset;
+
+    /**
+     * Constructor
+     *
+     * @param id The id of node
+     * @param name The name of node
+     * @param fields The field list of node
+     * @param watermarkField The watermark field of node only used for {@link ExtractMode#CDC}
+     * @param properties The properties connect to tidb
+     * @param primaryKey The primark key connect to tidb
+     * @param tableName The table name connect to tidb
+     * @param url The url connect to tidb
+     * @param database The database connect to tidb
+     * @param username The username  connect to tidb
+     * @param password The password  connect to tidb
+     * @param bootstrapServers The bootstrapServers connect to kafka
+     * @param topic The topic connect to kafka
+     * @param codec The codec is topic data of format
+     * @param groupId The kafka topic groupId
+     */
+    @JsonCreator
+    public TidbExtractNode(@Nonnull @JsonProperty("id") String id,
+            @Nonnull @JsonProperty("name") String name,
+            @Nonnull @JsonProperty("fields") List<FieldInfo> fields,
+            @Nullable @JsonProperty("watermarkField") WatermarkField watermarkField,
+            @JsonProperty("properties") Map<String, String> properties,
+            @JsonProperty("primaryKey") String primaryKey,
+            @Nullable @JsonProperty("url") String url,
+            @Nonnull @JsonProperty("tableName") String tableName,
+            @Nonnull @JsonProperty("database") String database,
+            @Nonnull @JsonProperty("username") String username,
+            @Nonnull @JsonProperty("password") String password,
+            @Nonnull @JsonProperty("bootstrapServers") String bootstrapServers,
+            @Nonnull @JsonProperty("topic") String topic,
+            @Nonnull @JsonProperty("codec") String codec,
+            @JsonProperty("groupId") String groupId,
+            @JsonProperty("autoOffsetReset") String autoOffsetReset
+    ) {
+        super(id, name, fields, watermarkField, properties);
+        this.url = Preconditions.checkNotNull(url, "url is null");
+        this.tableName = Preconditions.checkNotNull(tableName, "tableName is null");
+        this.database = Preconditions.checkNotNull(database, "database is null");
+        this.username = Preconditions.checkNotNull(username, "username is null");
+        this.password = Preconditions.checkNotNull(password, "password is null");
+        this.bootstrapServers = Preconditions.checkNotNull(bootstrapServers, "bootstrapServers is null");
+        this.topic = Preconditions.checkNotNull(topic, "topic is null");
+        this.codec = Preconditions.checkNotNull(codec, "codec is null");
+        this.groupId = groupId;
+        this.primaryKey = primaryKey;
+        this.autoOffsetReset = autoOffsetReset;
+    }
+
+    @Override
+    public String genTableName() {
+        return String.format("table_%s", super.getId());
+    }
+
+    @Override
+    public String getPrimaryKey() {
+        return primaryKey;
+    }
+
+    @Override
+    public Map<String, String> tableOptions() {
+        Map<String, String> options = super.tableOptions();
+
+        options.put("connector", "tidb");

Review Comment:
   Maybe it is better to extract constants for the constant string?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${dep.apache.commons.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${dep.guava.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${dep.apache.commons.version}</version>
+        </dependency>
+        <dependency>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>

Review Comment:
   Is this dependency require?



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${dep.jackson.version}</version>
+        </dependency>
+        <!-- tikv client -->
+        <dependency>
+            <groupId>org.tikv</groupId>
+            <artifactId>tikv-client-java</artifactId>
+            <version>${dep.tikv-client.version}</version>
+        </dependency>
+        <!-- apache commons -->
+        <dependency>

Review Comment:
   Is this dependency require?



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] chestnut-c commented on a diff in pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by GitBox <gi...@apache.org>.
chestnut-c commented on code in PR #6265:
URL: https://github.com/apache/inlong/pull/6265#discussion_r1002917757


##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java-bridge_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink-base.version}</version>
+            <scope>${flink-base.scope}</scope>
+        </dependency>
+        <!-- jackson -->
+        <dependency>

Review Comment:
   yes



##########
inlong-sort/sort-connectors/tidb/pom.xml:
##########
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sort-connectors</artifactId>
+        <groupId>org.apache.inlong</groupId>
+        <version>1.4.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sort-connector-tidb</artifactId>
+    <name>Apache InLong - Sort-connector-tidb</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <dep.flink.version>1.13.5</dep.flink.version>
+        <dep.flink-base.version>1.11.0</dep.flink-base.version>
+        <dep.scala.binary.version>2.12</dep.scala.binary.version>
+        <dep.tikv-client.version>3.2.0</dep.tikv-client.version>
+        <dep.jackson.version>2.11.0</dep.jackson.version>
+        <dep.guava.version>30.1.1-jre</dep.guava.version>
+        <dep.HikariCP.version>3.4.5</dep.HikariCP.version>
+        <dep.mysql.jdbc.version>8.0.21</dep.mysql.jdbc.version>
+        <dep.apache.commons.version>1.9.4</dep.apache.commons.version>
+
+        <flink-base.scope>provided</flink-base.scope>
+        <mysql.driver.scope>compile</mysql.driver.scope>
+        <flink.jdbc.connector.scope>compile</flink.jdbc.connector.scope>
+        <flink.kafka.connector.scope>compile</flink.kafka.connector.scope>
+    </properties>
+
+    <dependencies>
+        <!-- flink -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-jdbc_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.jdbc.connector.scope}</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-connector-kafka_${dep.scala.binary.version}</artifactId>
+            <version>${dep.flink.version}</version>
+            <scope>${flink.kafka.connector.scope}</scope>
+        </dependency>
+        <dependency>

Review Comment:
   yes



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] github-actions[bot] commented on pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6265:
URL: https://github.com/apache/inlong/pull/6265#issuecomment-1495228243

   This PR is stale because it has been open for 60 days with no activity.


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang closed pull request #6265: [INLONG-6264][Sort] Support TiDB

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang closed pull request #6265: [INLONG-6264][Sort] Support TiDB
URL: https://github.com/apache/inlong/pull/6265


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org