Package org.apache.kafka.connect.mirror
Class DefaultReplicationPolicy
java.lang.Object
org.apache.kafka.connect.mirror.DefaultReplicationPolicy
- All Implemented Interfaces:
Configurable,ReplicationPolicy
- Direct Known Subclasses:
IdentityReplicationPolicy
Default implementation of
ReplicationPolicy which prepends the source cluster alias to
remote topic names.
For example, if the source cluster alias is "us-west", topics created in the target cluster will be named
us-west.<TOPIC>. The separator is customizable by setting SEPARATOR_CONFIG and defaults to a period.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckpointsTopic(String clusterAlias) Returns the name of the checkpoints topic for given cluster alias.voidConfigure this class with the given key-value pairsformatRemoteTopic(String sourceClusterAlias, String topic) Returns the remote topic name for the given topic and source cluster alias.booleanisCheckpointsTopic(String topic) Returns true if the topic is a checkpoints topic.booleanisMM2InternalTopic(String topic) Returns true if the topic is one of MirrorMaker internal topics.offsetSyncsTopic(String clusterAlias) Returns the name of the offset-syncs topic for given cluster alias.topicSource(String topic) Returns the source cluster alias of given topic.upstreamTopic(String topic) Return the name of the given topic on the source cluster.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.connect.mirror.ReplicationPolicy
heartbeatsTopic, isHeartbeatsTopic, isInternalTopic, originalTopic
-
Field Details
-
SEPARATOR_CONFIG
- See Also:
-
SEPARATOR_DEFAULT
- See Also:
-
INTERNAL_TOPIC_SEPARATOR_ENABLED_CONFIG
- See Also:
-
INTERNAL_TOPIC_SEPARATOR_ENABLED_DEFAULT
-
-
Constructor Details
-
DefaultReplicationPolicy
public DefaultReplicationPolicy()
-
-
Method Details
-
configure
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
configurein interfaceConfigurable
-
formatRemoteTopic
Description copied from interface:ReplicationPolicyReturns the remote topic name for the given topic and source cluster alias.- Specified by:
formatRemoteTopicin interfaceReplicationPolicy
-
topicSource
Description copied from interface:ReplicationPolicyReturns the source cluster alias of given topic. Returns null if the given topic is not a remote topic.- Specified by:
topicSourcein interfaceReplicationPolicy
-
upstreamTopic
Description copied from interface:ReplicationPolicyReturn the name of the given topic on the source cluster.Topics may be replicated multiple hops, so the immediately upstream topic may itself be a remote topic.
Returns null if the given topic is not a remote topic.
- Specified by:
upstreamTopicin interfaceReplicationPolicy
-
offsetSyncsTopic
Description copied from interface:ReplicationPolicyReturns the name of the offset-syncs topic for given cluster alias.- Specified by:
offsetSyncsTopicin interfaceReplicationPolicy
-
checkpointsTopic
Description copied from interface:ReplicationPolicyReturns the name of the checkpoints topic for given cluster alias.- Specified by:
checkpointsTopicin interfaceReplicationPolicy
-
isCheckpointsTopic
Description copied from interface:ReplicationPolicyReturns true if the topic is a checkpoints topic.- Specified by:
isCheckpointsTopicin interfaceReplicationPolicy
-
isMM2InternalTopic
Description copied from interface:ReplicationPolicyReturns true if the topic is one of MirrorMaker internal topics. This is used to make sure the topic doesn't need to be replicated.- Specified by:
isMM2InternalTopicin interfaceReplicationPolicy
-