Skip to content

Commit da491c8

Browse files
committed
fix some desc and replace use tableid to explain
1 parent 37c544c commit da491c8

2 files changed

Lines changed: 0 additions & 57 deletions

File tree

flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/assigners/MySqlSnapshotSplitAssigner.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,6 @@ else if (!isRemainingTablesCheckpointed
222222
}
223223

224224
private void captureNewlyAddedTables() {
225-
// Binlog-only mode: no action needed in Assigner, BinlogSplitReader handles it
226-
if (sourceConfig.isScanBinlogNewlyAddedTableEnabled()) {
227-
LOG.info(
228-
"Binlog-only newly added table capture is enabled. "
229-
+ "New tables matching the pattern will be automatically captured "
230-
+ "in binlog phase without snapshot.");
231-
// No action needed here, BinlogSplitReader will handle the auto-capture
232-
return;
233-
}
234-
235225
// Don't scan newly added table in snapshot mode.
236226
if (sourceConfig.isScanNewlyAddedTableEnabled()
237227
&& !sourceConfig.getStartupOptions().isSnapshotOnly()) {

flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/config/MySqlSourceConfigFactory.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import org.apache.flink.table.catalog.ObjectPath;
2626

2727
import io.debezium.config.CommonConnectorConfig;
28-
import org.slf4j.Logger;
29-
import org.slf4j.LoggerFactory;
3028

3129
import java.io.Serializable;
3230
import java.time.Duration;
@@ -37,7 +35,6 @@
3735
import java.util.Map;
3836
import java.util.Properties;
3937
import java.util.UUID;
40-
import java.util.stream.Collectors;
4138

4239
import static org.apache.flink.cdc.connectors.mysql.source.utils.EnvironmentUtils.checkSupportCheckpointsAfterTasksFinished;
4340
import static org.apache.flink.util.Preconditions.checkNotNull;
@@ -47,7 +44,6 @@
4744
public class MySqlSourceConfigFactory implements Serializable {
4845

4946
private static final long serialVersionUID = 1L;
50-
private static final Logger LOG = LoggerFactory.getLogger(MySqlSourceConfigFactory.class);
5147

5248
private int port = 3306; // default 3306 port
5349
private String hostname;
@@ -477,47 +473,4 @@ public MySqlSourceConfig createConfig(int subtaskId, String serverName) {
477473
useLegacyJsonFormat,
478474
assignUnboundedChunkFirst);
479475
}
480-
481-
/**
482-
* Convert Flink CDC style table pattern to Debezium style.
483-
*
484-
* <p>In CDC-style table matching, table names are separated by commas and use `\.` for regex
485-
* matching. In Debezium style, table names are separated by pipes and use `.` for regex
486-
* matching while `\.` is used as database.table separator.
487-
*
488-
* <p>Examples:
489-
*
490-
* <ul>
491-
* <li>{@code "db1.table_\.*,db2.user_\.*"} -> {@code "db1\.table_.*|db2\.user_.*"}
492-
* <li>{@code "test_db.orders"} -> {@code "test_db\.orders"}
493-
* </ul>
494-
*
495-
* @param tables Flink CDC style table pattern
496-
* @return Debezium style table pattern
497-
*/
498-
private static String convertToDebeziumStyle(String tables) {
499-
LOG.debug("Converting table pattern to Debezium style: {}", tables);
500-
501-
// Step 1: Replace comma separator with pipe (OR semantics)
502-
tables =
503-
Arrays.stream(tables.split(",")).map(String::trim).collect(Collectors.joining("|"));
504-
LOG.debug("After replacing comma with pipe separator: {}", tables);
505-
506-
// Step 2: Replace escaped dot \. with placeholder
507-
// In Flink CDC, \. means a literal dot in regex, in Debezium it should be . (any
508-
// character).
509-
String unescapedTables = tables.replace("\\.", "$");
510-
LOG.debug("After unescaping dots as RegEx meta-character: {}", unescapedTables);
511-
512-
// Step 3: Replace unescaped dot . with \.
513-
// In Flink CDC, unescaped . is database.table separator, in Debezium it should be \.
514-
String escapedTables = unescapedTables.replace(".", "\\.");
515-
LOG.debug("After escaping dots as separator: {}", escapedTables);
516-
517-
// Step 4: Restore placeholder to regular dot .
518-
String debeziumStyle = escapedTables.replace("$", ".");
519-
LOG.debug("Final Debezium-style table pattern: {}", debeziumStyle);
520-
521-
return debeziumStyle;
522-
}
523476
}

0 commit comments

Comments
 (0)