dockerzhang commented on code in PR #4113:
URL: https://github.com/apache/incubator-inlong/pull/4113#discussion_r867598547
##########
inlong-agent/agent-plugins/pom.xml:
##########
@@ -69,6 +76,17 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ <version>${kafka.clients.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+ <scope>runtime</scope>
Review Comment:
due to the license reason, we should not add the MySQL dependency.
##########
inlong-agent/agent-plugins/src/test/java/org/apache/inlong/agent/plugin/sources/TestBinlogReader.java:
##########
@@ -18,43 +18,70 @@
package org.apache.inlong.agent.plugin.sources;
import com.google.gson.Gson;
+import org.apache.inlong.agent.conf.JobProfile;
+import org.apache.inlong.agent.plugin.sources.reader.BinlogReader;
import org.apache.inlong.agent.pojo.DebeziumFormat;
import org.junit.Assert;
import org.junit.Test;
+import static
org.apache.inlong.agent.constant.CommonConstants.PROXY_INLONG_GROUP_ID;
+import static
org.apache.inlong.agent.constant.CommonConstants.PROXY_INLONG_STREAM_ID;
+
public class TestBinlogReader {
private static Gson gson = new Gson();
@Test
public void testDebeziumFormat() {
String debeziumJson = "{\n"
- + " \"before\": null,\n"
- + " \"after\": {\n"
- + " \"id\": 1004,\n"
- + " \"first_name\": \"Anne\",\n"
- + " \"last_name\": \"Kretchmar\",\n"
- + " \"email\": \"[email protected]\"\n"
- + " },\n"
- + " \"source\": {\n"
- + " \"version\": \"1.8.1.Final\",\n"
- + " \"name\": \"dbserver1\",\n"
- + " \"server_id\": 0,\n"
- + " \"ts_sec\": 0,\n"
- + " \"gtid\": null,\n"
- + " \"file\": \"mysql-bin.000003\",\n"
- + " \"pos\": 154,\n"
- + " \"row\": 0,\n"
- + " \"snapshot\": true,\n"
- + " \"thread\": null,\n"
- + " \"db\": \"inventory\",\n"
- + " \"table\": \"customers\"\n"
- + " },\n"
- + " \"op\": \"r\",\n"
- + " \"ts_ms\": 1486500577691\n"
- + " }";
+ + " \"before\": null,\n"
+ + " \"after\": {\n"
+ + " \"id\": 1004,\n"
+ + " \"first_name\": \"Anne\",\n"
+ + " \"last_name\": \"Kretchmar\",\n"
+ + " \"email\": \"[email protected]\"\n"
+ + " },\n"
+ + " \"source\": {\n"
+ + " \"version\": \"1.8.1.Final\",\n"
+ + " \"name\": \"dbserver1\",\n"
+ + " \"server_id\": 0,\n"
+ + " \"ts_sec\": 0,\n"
+ + " \"gtid\": null,\n"
+ + " \"file\": \"mysql-bin.000003\",\n"
+ + " \"pos\": 154,\n"
+ + " \"row\": 0,\n"
+ + " \"snapshot\": true,\n"
+ + " \"thread\": null,\n"
+ + " \"db\": \"inventory\",\n"
+ + " \"table\": \"customers\"\n"
+ + " },\n"
+ + " \"op\": \"r\",\n"
+ + " \"ts_ms\": 1486500577691\n"
+ + " }";
DebeziumFormat debeziumFormat = gson
- .fromJson(debeziumJson, DebeziumFormat.class);
+ .fromJson(debeziumJson, DebeziumFormat.class);
Assert.assertEquals("customers",
debeziumFormat.getSource().getTable());
}
+
+ // @Test
+ public void binlogStartSpacialTest() throws Exception {
+ JobProfile jobProfile = new JobProfile();
+ jobProfile.set(BinlogReader.JOB_DATABASE_USER, "root");
+ jobProfile.set(BinlogReader.JOB_DATABASE_PASSWORD, "123456");
+ jobProfile.set(BinlogReader.JOB_DATABASE_HOSTNAME, "9.135.12.10");
Review Comment:
remove the IP, it's better to mock the UT.
##########
inlong-agent/agent-plugins/pom.xml:
##########
@@ -29,6 +29,13 @@
<modelVersion>4.0.0</modelVersion>
<name>Apache InLong - Agent Plugins</name>
+ <properties>
+ <kafka.clients.version>3.0.0</kafka.clients.version>
+ <mysql-connector-java.version>8.0.27</mysql-connector-java.version>
+
<flink-shaded-jackson.version>2.12.1-13.0</flink-shaded-jackson.version>
+
<agent-flink.connector.mysql.cdc.version>2.2.0</agent-flink.connector.mysql.cdc.version>
+ </properties>
Review Comment:
please move the version definition to the root pom.xml
--
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]