Skip to content

Commit

Permalink
rename module
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Aug 16, 2024
1 parent 3593db3 commit f7c33a5
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 50 deletions.
1 change: 1 addition & 0 deletions plugin-mapping.properties
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ seatunnel.source.Maxcompute = connector-maxcompute
seatunnel.sink.Maxcompute = connector-maxcompute
seatunnel.source.MySQL-CDC = connector-cdc-mysql
seatunnel.source.MongoDB-CDC = connector-cdc-mongodb
seatunnel.source.TiDB-CDC = connector-cdc-tidb
seatunnel.sink.S3Redshift = connector-s3-redshift
seatunnel.source.Web3j = connector-web3j
seatunnel.source.TDengine = connector-tdengine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class TiDBSource
SupportParallelism,
SupportColumnProjection {

static final String IDENTIFIER = "TIDB-CDC";
static final String IDENTIFIER = "TiDB-CDC";

private TiDBSourceConfig config;
private final CatalogTable catalogTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String factoryIdentifier() {
*/
@Override
public OptionRule optionRule() {
return TiDBSourceOptions.getBaseRule()
return OptionRule.builder()
.required(
TiDBSourceOptions.DATABASE_NAME,
TiDBSourceOptions.TABLE_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,34 @@

package org.apache.seatunnel.connectors.seatunnel.cdc.tidb.source.config;

import org.apache.seatunnel.api.configuration.Option;
import org.apache.seatunnel.api.configuration.Options;
import org.apache.seatunnel.api.configuration.ReadonlyConfig;
import org.apache.seatunnel.api.configuration.SingleChoiceOption;
import org.apache.seatunnel.connectors.cdc.base.option.JdbcSourceOptions;
import org.apache.seatunnel.connectors.cdc.base.option.SourceOptions;
import org.apache.seatunnel.connectors.cdc.base.option.StartupMode;

import org.tikv.common.ConfigUtils;
import org.tikv.common.TiConfiguration;

import java.io.Serializable;
import java.util.Arrays;

/** TiDB source options */
public class TiDBSourceOptions extends JdbcSourceOptions {
public class TiDBSourceOptions implements Serializable {

public static final SingleChoiceOption<String> DATABASE_NAME =
(SingleChoiceOption<String>)
Options.key("database-name")
.stringType()
.noDefaultValue()
.withDescription("Database name of the TiDB server to monitor.");
public static final Option<String> DATABASE_NAME =
Options.key("database-name")
.stringType()
.noDefaultValue()
.withDescription("Database name of the TiDB server to monitor.");

public static final SingleChoiceOption<String> TABLE_NAME =
(SingleChoiceOption<String>)
Options.key("table-name")
.stringType()
.noDefaultValue()
.withDescription("Table name of the database to monitor.");
public static final Option<String> TABLE_NAME =
Options.key("table-name")
.stringType()
.noDefaultValue()
.withDescription("Table name of the database to monitor.");

public static final SingleChoiceOption<StartupMode> STARTUP_MODE =
public static final Option<StartupMode> STARTUP_MODE =
Options.key(SourceOptions.STARTUP_MODE_KEY)
.singleChoice(
StartupMode.class,
Expand All @@ -56,40 +54,35 @@ public class TiDBSourceOptions extends JdbcSourceOptions {
"Optional startup mode for CDC source, valid enumerations are "
+ "\"initial\", \"earliest\", \"latest\", \"timestamp\"\n or \"specific\"");

public static final SingleChoiceOption<String> PD_ADDRESSES =
(SingleChoiceOption<String>)
Options.key("pd-addresses")
.stringType()
.noDefaultValue()
.withDescription("TiKV cluster's PD address");
public static final Option<String> PD_ADDRESSES =
Options.key("pd-addresses")
.stringType()
.noDefaultValue()
.withDescription("TiKV cluster's PD address");

public static final SingleChoiceOption<Long> TIKV_GRPC_TIMEOUT =
(SingleChoiceOption<Long>)
Options.key(ConfigUtils.TIKV_GRPC_TIMEOUT)
.longType()
.noDefaultValue()
.withDescription("TiKV GRPC timeout in ms");
public static final Option<Long> TIKV_GRPC_TIMEOUT =
Options.key(ConfigUtils.TIKV_GRPC_TIMEOUT)
.longType()
.noDefaultValue()
.withDescription("TiKV GRPC timeout in ms");

public static final SingleChoiceOption<Long> TIKV_GRPC_SCAN_TIMEOUT =
(SingleChoiceOption<Long>)
Options.key(ConfigUtils.TIKV_GRPC_SCAN_TIMEOUT)
.longType()
.noDefaultValue()
.withDescription("TiKV GRPC scan timeout in ms");
public static final Option<Long> TIKV_GRPC_SCAN_TIMEOUT =
Options.key(ConfigUtils.TIKV_GRPC_SCAN_TIMEOUT)
.longType()
.noDefaultValue()
.withDescription("TiKV GRPC scan timeout in ms");

public static final SingleChoiceOption<Integer> TIKV_BATCH_GET_CONCURRENCY =
(SingleChoiceOption<Integer>)
Options.key(ConfigUtils.TIKV_BATCH_GET_CONCURRENCY)
.intType()
.noDefaultValue()
.withDescription("TiKV GRPC batch get concurrency");
public static final Option<Integer> TIKV_BATCH_GET_CONCURRENCY =
Options.key(ConfigUtils.TIKV_BATCH_GET_CONCURRENCY)
.intType()
.noDefaultValue()
.withDescription("TiKV GRPC batch get concurrency");

public static final SingleChoiceOption<Integer> TIKV_BATCH_SCAN_CONCURRENCY =
(SingleChoiceOption<Integer>)
Options.key(ConfigUtils.TIKV_BATCH_SCAN_CONCURRENCY)
.intType()
.noDefaultValue()
.withDescription("TiKV GRPC batch scan concurrency");
public static final Option<Integer> TIKV_BATCH_SCAN_CONCURRENCY =
Options.key(ConfigUtils.TIKV_BATCH_SCAN_CONCURRENCY)
.intType()
.noDefaultValue()
.withDescription("TiKV GRPC batch scan concurrency");

public static TiConfiguration getTiConfiguration(final ReadonlyConfig configuration) {
final String pdAddrsStr = configuration.get(PD_ADDRESSES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<version>${revision}</version>
</parent>

<artifactId>connector-tidb-e2e</artifactId>
<artifactId>connector-cdc-tidb-e2e</artifactId>
<name>SeaTunnel : E2E : Connector V2 : TiDB</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ source {
result_table_name = "trans_tidb_all_type_cdc"
base-url = "jdbc:mysql://tidb-e2e:4000/column_type_test"
driver = "com.mysql.cj.jdbc.Driver"
tikv.grpc.timeout_in_ms = 20000
pd-addresses = "pd-e2e:2379"
user = "root"
password = "seatunnel"
database-name = "column_type_test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ source {
result_table_name = "customers_tidb_cdc"
base-url = "jdbc:mysql://tidb-e2e:4000/inventory"
driver = "com.mysql.cj.jdbc.Driver"
tikv.grpc.timeout_in_ms = 20000
pd-addresses = "pd-e2e:2379"
user = "root"
password = "seatunnel"
database-name = "inventory"
Expand Down
2 changes: 1 addition & 1 deletion seatunnel-e2e/seatunnel-connector-v2-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<module>connector-hudi-e2e</module>
<module>connector-milvus-e2e</module>
<module>connector-activemq-e2e</module>
<module>connector-tidb-e2e</module>
<module>connector-cdc-tidb-e2e</module>
</modules>

<dependencies>
Expand Down

0 comments on commit f7c33a5

Please sign in to comment.