Package io.debezium.schema
Class DefaultRegexTopicNamingStrategy
java.lang.Object
io.debezium.schema.AbstractTopicNamingStrategy<DataCollectionId>
io.debezium.schema.DefaultRegexTopicNamingStrategy
- All Implemented Interfaces:
TopicNamingStrategy<DataCollectionId>
@Incubating
public class DefaultRegexTopicNamingStrategy
extends AbstractTopicNamingStrategy<DataCollectionId>
Implement a regex expression strategy to determine data event topic names using
DataCollectionId.databaseParts().- Author:
- Harvey Yue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerstatic final Fieldstatic final Fieldprivate Patternprivate StringFields inherited from class io.debezium.schema.AbstractTopicNamingStrategy
DEFAULT_HEARTBEAT_TOPIC_PREFIX, DEFAULT_TRANSACTION_TOPIC, delimiter, heartbeatPrefix, LOGIC_NAME_PLACEHOLDER, logicalName, prefix, TOPIC_CACHE_SIZE, TOPIC_DELIMITER, TOPIC_HEARTBEAT_PREFIX, TOPIC_NAME_PATTERN, TOPIC_PREFIX, TOPIC_TRANSACTION, topicNames, transactionFields inherited from interface io.debezium.spi.topic.TopicNamingStrategy
REPLACEMENT_CHAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Properties props) private StringdetermineNewTopic(DataCollectionId tableId, String oldTopic) Determine the new topic name.private static intvalidateTopicReplacement(Configuration config, Field field, Field.ValidationOutput problems) If TOPIC_REGEX has a value that is really a regex, then the TOPIC_REPLACEMENT must be a non-empty value.Methods inherited from class io.debezium.schema.AbstractTopicNamingStrategy
heartbeatTopic, mkString, schemaChangeTopic, transactionTopic, validateTopicNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.spi.topic.TopicNamingStrategy
sanitizedTopicName
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TOPIC_REGEX
-
TOPIC_REPLACEMENT
-
topicRegex
-
topicReplacement
-
-
Constructor Details
-
DefaultRegexTopicNamingStrategy
-
-
Method Details
-
validateTopicReplacement
private static int validateTopicReplacement(Configuration config, Field field, Field.ValidationOutput problems) If TOPIC_REGEX has a value that is really a regex, then the TOPIC_REPLACEMENT must be a non-empty value. -
configure
- Specified by:
configurein interfaceTopicNamingStrategy<DataCollectionId>- Overrides:
configurein classAbstractTopicNamingStrategy<DataCollectionId>
-
dataChangeTopic
- Specified by:
dataChangeTopicin interfaceTopicNamingStrategy<DataCollectionId>- Specified by:
dataChangeTopicin classAbstractTopicNamingStrategy<DataCollectionId>
-
determineNewTopic
Determine the new topic name.- Parameters:
tableId- the table idoldTopic- the name of the old topic- Returns:
- return the new topic name, if the regex applies. Otherwise, return original topic.
-