Skip to content

Commit 376344f

Browse files
add debezium config to avoid unnecessary ddl event (#167)
1 parent ca63a3f commit 376344f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

mysql-delta-plugins/src/main/java/io/cdap/delta/mysql/MySqlEventReader.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ public void start(Offset offset) {
117117
.with("database.user", config.getUser())
118118
.with("database.password", config.getPassword())
119119
.with("database.history", DBSchemaHistory.class.getName())
120-
.with("database.whitelist", config.getDatabase())
120+
.with("database.include.list", config.getDatabase())
121121
.with("database.server.name", "dummy") // this is the kafka topic for hosted debezium - it doesn't matter
122122
.with("database.serverTimezone", config.getServerTimezone())
123-
.with("table.whitelist", String.join(",", sourceTableMap.keySet()))
123+
.with("database.history.store.only.monitored.tables.ddl", true)
124+
.with("table.include.list", String.join(",", sourceTableMap.keySet()))
124125
.with("snapshot.mode", config.getReplicateExistingData() ? "initial" : "schema_only")
125-
.with(MySqlConstantOffsetBackingStore.REPLICATION_CONNECTOR_NAME, replicationConnectorName);;
126+
.with(MySqlConstantOffsetBackingStore.REPLICATION_CONNECTOR_NAME, replicationConnectorName);
126127

127128
if (config.getConsumerID() != null) {
128129
// If not provided debezium will randomly pick integer between 5400 and 6400.
@@ -135,6 +136,7 @@ public void start(Offset offset) {
135136
}
136137

137138
Configuration debeziumConf = configBuilder.build();
139+
LOG.info("Debezium configuration : {}", debeziumConf);
138140
MySqlConnectorConfig mysqlConf = new MySqlConnectorConfig(debeziumConf);
139141
DBSchemaHistory.deltaRuntimeContext = context;
140142
/*

mysql-delta-plugins/src/main/java/io/cdap/delta/mysql/MySqlRecordConsumer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ public void accept(SourceRecord sourceRecord) {
113113
} catch (IOException e) {
114114
LOG.warn("Unable to set source state to OK.", e);
115115
}
116-
116+
if (LOG.isTraceEnabled()) {
117+
LOG.trace("Receiving source record {}", sourceRecord);
118+
}
117119
if (sourceRecord.value() == null) {
118120
return;
119121
}

0 commit comments

Comments
 (0)