Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Aug 12, 2024
1 parent fbbedf2 commit 8d99f14
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
public class TiDBCDCIT extends TiDBTestBase implements TestResource {
private final String SQL_TEMPLATE = "select id,name,description,weight from %s.%s";
private final String DATABASE_NAME = "inventory";
private final String SOURCE_TABLE_NAME = "products";
private final String SINK_TABLE_NAME = "products_sink";

@BeforeAll
@Override
Expand All @@ -58,7 +56,6 @@ public void testAllEvents(TestContainer container) throws Exception {

try (Connection connection = getJdbcConnection("inventory");
Statement statement = connection.createStatement()) {

statement.execute(
"UPDATE products SET description='18oz carpenter hammer' WHERE id=106;");
statement.execute("UPDATE products SET weight='5.1' WHERE id=107;");
Expand All @@ -77,8 +74,8 @@ public void testAllEvents(TestContainer container) throws Exception {
.untilAsserted(
() -> {
Assertions.assertIterableEquals(
query(getQuerySQL(DATABASE_NAME, SOURCE_TABLE_NAME)),
query(getQuerySQL(DATABASE_NAME, SINK_TABLE_NAME)));
query(getQuerySQL(DATABASE_NAME, "products")),
query(getQuerySQL(DATABASE_NAME, "products_sink")));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
public class TiDBTestBase extends TestSuiteBase {
private static final Pattern COMMENT_PATTERN = Pattern.compile("^(.*)--.*$");

public static final String PD_SERVICE_NAME = "pd0";
public static final String TIKV_SERVICE_NAME = "tikv0";
public static final String TIDB_SERVICE_NAME = "tidb0";
public static final String PD_CONTAINER_HOST = "pd-e2e";
public static final String TIKV_CONTAINER_HOST = "tikv-e2e";
public static final String TIDB_CONTAINER_HOST = "tidb-e2e";

public static final String TIDB_USER = "root";
public static final String TIDB_PASSWORD = "";
public static final String TIDB_PASSWORD = "seatunnel";

public static final int TIDB_PORT = 4000;
public static final int TIKV_PORT_ORIGIN = 20160;
Expand All @@ -83,7 +83,7 @@ public class TiDBTestBase extends TestSuiteBase {
"--config=/pd.toml",
"--log-file=/logs/pd0.log")
.withNetwork(NETWORK)
.withNetworkAliases(PD_SERVICE_NAME)
.withNetworkAliases(PD_CONTAINER_HOST)
.withStartupTimeout(Duration.ofSeconds(120))
.withLogConsumer(new Slf4jLogConsumer(log));

Expand All @@ -100,7 +100,7 @@ public class TiDBTestBase extends TestSuiteBase {
"--log-file=/logs/tikv0.log")
.withNetwork(NETWORK)
.dependsOn(PD)
.withNetworkAliases(TIKV_SERVICE_NAME)
.withNetworkAliases(TIKV_CONTAINER_HOST)
.withStartupTimeout(Duration.ofSeconds(120))
.withLogConsumer(new Slf4jLogConsumer(log));

Expand All @@ -115,7 +115,7 @@ public class TiDBTestBase extends TestSuiteBase {
"--advertise-address=tidb0")
.withNetwork(NETWORK)
.dependsOn(TIKV)
.withNetworkAliases(TIDB_SERVICE_NAME)
.withNetworkAliases(TIDB_CONTAINER_HOST)
.withStartupTimeout(Duration.ofSeconds(120))
.withLogConsumer(new Slf4jLogConsumer(log));

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,30 @@ env {

source {
# This is a example source plugin **only for test and demonstrate the feature source plugin**
TDengine {
url: "jdbc:TAOS-RS://flink_e2e_tdengine_src:6041/"
username: "root"
password: "taosdata"
database: "power"
stable: "meters"
lower_bound: "2018-10-03 14:38:05.000"
upper_bound: "2018-10-03 14:38:16.801"
result_table_name = "tdengine_result"
TiDB-CDC {
result_table_name = "customers_tidb_cdc"
base-url = "jdbc:mysql://tidb-e2e:4000/inventory"
driver = "com.mysql.cj.jdbc.Driver"
user = "root"
password = "seatunnel"
database-name = "inventory"
table-name = "products"
}
# If you would like to get more information about how to configure seatunnel and see full list of source plugins,
# please go to https://seatunnel.apache.org/docs/category/source-v2
}

transform {
}

sink {
TDengine {
url: "jdbc:TAOS-RS://flink_e2e_tdengine_sink:6041/"
username: "root"
password: "taosdata"
database: "power2"
stable: "meters2"
timezone: "UTC"
jdbc {
source_table_name = "trans_tidb_cdc"
url = "jdbc:mysql://tidb-e2e:4000/inventory"
driver = "com.mysql.cj.jdbc.Driver"
user = "root"
password = "seatunnel"
database = "inventory"
table = "products_sink"
generate_sink_sql = true
primary_keys = ["id"]
}
# If you would like to get more information about how to configure seatunnel and see full list of sink plugins,
# please go to https://seatunnel.apache.org/docs/category/sink-v2
}

0 comments on commit 8d99f14

Please sign in to comment.