Package io.debezium.schema
Class TopicSelector<I extends DataCollectionId>
java.lang.Object
io.debezium.schema.TopicSelector<I>
- Type Parameters:
I- The type ofDataCollectionIdused by a given implementation
Implementations return names for Kafka topics (data and meta-data).
- Author:
- Randal Hauch, Gunnar Morling
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceImplementations determine the topic name corresponding to a given data collection.private static classA topic namer that caches names it has obtained from a delegate.private static classA topic namer that replaces any characters invalid in a topic name with_. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TopicSelector.DataCollectionTopicNamer<I>private final Stringprivate final Stringprivate final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTopicSelector(String prefix, String heartbeatPrefix, String delimiter, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer) -
Method Summary
Modifier and TypeMethodDescriptionstatic <I extends DataCollectionId>
TopicSelector<I>defaultSelector(CommonConnectorConfig connectorConfig, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer) static <I extends DataCollectionId>
TopicSelector<I>defaultSelector(String prefix, String heartbeatPrefix, String delimiter, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer) Get the name of the heartbeat topic for the given server.Get the name of the primary topic.topicNameFor(I id) Returns the name of the Kafka topic for a given data collection identifier
-
Field Details
-
prefix
-
heartbeatPrefix
-
delimiter
-
dataCollectionTopicNamer
private final TopicSelector.DataCollectionTopicNamer<I extends DataCollectionId> dataCollectionTopicNamer
-
-
Constructor Details
-
TopicSelector
private TopicSelector(String prefix, String heartbeatPrefix, String delimiter, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer)
-
-
Method Details
-
defaultSelector
public static <I extends DataCollectionId> TopicSelector<I> defaultSelector(String prefix, String heartbeatPrefix, String delimiter, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer) -
defaultSelector
public static <I extends DataCollectionId> TopicSelector<I> defaultSelector(CommonConnectorConfig connectorConfig, TopicSelector.DataCollectionTopicNamer<I> dataCollectionTopicNamer) -
topicNameFor
Returns the name of the Kafka topic for a given data collection identifier- Parameters:
id- the data collection identifier, nevernull- Returns:
- the name of the Kafka topic, never
null
-
getPrimaryTopic
Get the name of the primary topic.- Returns:
- the topic name; never null
-
getHeartbeatTopic
Get the name of the heartbeat topic for the given server. This method returns "<prefix>-heartbeat".- Returns:
- the topic name; never null
-