Skip to content

Commit

Permalink
DBZ-8325 Remove unused variable & update java doc
Browse files Browse the repository at this point in the history
  • Loading branch information
twthorn committed Oct 22, 2024
1 parent c379e0d commit 492d32e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
public class TableTopicNamingStrategy extends AbstractTopicNamingStrategy<TableId> {

private final String overrideDataChangeTopicPrefix;
private final String overrideSchemaChangeTopicName;
private final String overrideSchemaChangeTopic;

public TableTopicNamingStrategy(Properties props) {
super(props);
Configuration config = Configuration.from(props);
this.overrideDataChangeTopicPrefix = config.getString(VitessConnectorConfig.OVERRIDE_DATA_CHANGE_TOPIC_PREFIX);
this.overrideSchemaChangeTopicName = config.getString(VitessConnectorConfig.OVERRIDE_SCHEMA_CHANGE_TOPIC);
this.overrideSchemaChangeTopic = config.getString(VitessConnectorConfig.OVERRIDE_SCHEMA_CHANGE_TOPIC);
}

public static TableTopicNamingStrategy create(CommonConnectorConfig config) {
Expand All @@ -47,11 +47,19 @@ public String dataChangeTopic(TableId id) {
return topicNames.computeIfAbsent(id, t -> sanitizedTopicName(topicName));
}

/**
* Return the schema change topic. There are two cases:
* 1. If override schema change topic is specified - use this as the topic name
* 2. If override schema change topic is not specified - return the `topic.prefix` specified by the
* {@link CommonConnectorConfig.TOPIC_PREFIX} config (unique to
* each connector, so it doesn't risk name conflicts)
*
* @return String representing the schema change topic name.
*/
@Override
public String schemaChangeTopic() {
String topicName;
if (!Strings.isNullOrBlank(overrideSchemaChangeTopicName)) {
return overrideSchemaChangeTopicName;
if (!Strings.isNullOrBlank(overrideSchemaChangeTopic)) {
return overrideSchemaChangeTopic;
}
else {
return prefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
import io.debezium.connector.binlog.jdbc.BinlogValueConverters;
import io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser;
import io.debezium.connector.vitess.VitessConnectorConfig;
import io.debezium.connector.vitess.VitessDatabaseSchema;
import io.debezium.jdbc.JdbcValueConverters;
import io.debezium.jdbc.TemporalPrecisionMode;
import io.debezium.relational.Column;
import io.debezium.service.spi.ServiceRegistry;

/**
* Create a binlog value converter class to be passed into the
* {@link VitessDefaultValueConverter} in the {@link VitessDatabaseSchema}
* @author Thomas Thornton
*/
public class VitessBinlogValueConverter extends BinlogValueConverters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import io.debezium.jdbc.JdbcConnection;

/**
* Needed to maintain compatibility with RelationalSnapshotChangeEventSource
* A connection with Vitess that is JDBC compatible.
*
* Needed to maintain compatibility with {@link io.debezium.relational.RelationalSnapshotChangeEventSource}
*
* TODO: Move all query-based interactions with Vitess onto this class.
* Currently we do these with VitessReplicationConnection instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import io.debezium.connector.binlog.jdbc.BinlogValueConverters;

/**
* Create a binlog default value converter to be passed into the {@link io.debezium.relational.TableSchemaBuilder}
* in {@link io.debezium.connector.vitess.VitessDatabaseSchema}
* @author Thomas Thornton
*/
public class VitessDefaultValueConverter extends BinlogDefaultValueConverter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import org.junit.After;

/**
* Used to tear down the {@link VitessDatabaseSchema} and {@link VitessConnectorTask} after each
* test to avoid resource conflicts.
*
* @author Thomas Thornton
*/
public class VitessTestCleanup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.junit.Test;

/**
* Verify the behavior of {@link DdlMessage}
*
* @author Thomas Thornton
*/
public class DdlMessageTest {
Expand Down

0 comments on commit 492d32e

Please sign in to comment.