leonardBang commented on code in PR #3336: URL: https://github.com/apache/flink-cdc/pull/3336#discussion_r1608027592
########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-tidb-cdc/src/main/java/org/apache/flink/cdc/connectors/tidb/TDBSourceOptions.java: ########## @@ -82,10 +90,13 @@ private TDBSourceOptions() {} .withDescription("TiKV GRPC batch scan concurrency"); public static TiConfiguration getTiConfiguration( - final String pdAddrsStr, final Map<String, String> options) { + final String pdAddrsStr, final String hostMapping, final Map<String, String> options) { Review Comment: Could we add a new method named `getTiConfiguration( final String pdAddrsStr, final Map<String, String> options) { final String pdAddrsStr, final String hostMapping, final Map<String, String> options)` instead of changing the exits one ? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-tidb-cdc/src/main/java/org/apache/flink/cdc/connectors/tidb/TDBSourceOptions.java: ########## @@ -57,6 +59,12 @@ private TDBSourceOptions() {} .noDefaultValue() .withDescription("TiKV cluster's PD address"); + public static final ConfigOption<String> HOST_MAPPING = + ConfigOptions.key("host-mapping") Review Comment: Could we also update connector documentation as well ? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-tidb-cdc/src/main/java/org/apache/flink/cdc/connectors/tidb/TDBSourceOptions.java: ########## @@ -82,10 +90,13 @@ private TDBSourceOptions() {} .withDescription("TiKV GRPC batch scan concurrency"); public static TiConfiguration getTiConfiguration( - final String pdAddrsStr, final Map<String, String> options) { + final String pdAddrsStr, final String hostMapping, final Map<String, String> options) { final Configuration configuration = Configuration.fromMap(options); final TiConfiguration tiConf = TiConfiguration.createDefault(pdAddrsStr); + if (StringUtils.isNotBlank(hostMapping)) { Review Comment: Could we use Flink's `Preconditions` check utils instead of introducing external dependency ? ########## flink-cdc-connect/flink-cdc-source-connectors/flink-connector-tidb-cdc/src/main/java/org/apache/flink/cdc/connectors/tidb/table/TiDBTableSource.java: ########## @@ -70,12 +72,14 @@ public TiDBTableSource( String database, String tableName, String pdAddresses, + String hostMapping, Review Comment: @Nullable -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org