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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckpointsTopic
(String clusterAlias) Returns the name of the checkpoints topic for given cluster alias.void
Configure 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.boolean
isCheckpointsTopic
(String topic) Returns true if the topic is a checkpoints topic.boolean
isMM2InternalTopic
(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, wait
Methods 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:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
-
formatRemoteTopic
Description copied from interface:ReplicationPolicy
Returns the remote topic name for the given topic and source cluster alias.- Specified by:
formatRemoteTopic
in interfaceReplicationPolicy
-
topicSource
Description copied from interface:ReplicationPolicy
Returns the source cluster alias of given topic. Returns null if the given topic is not a remote topic.- Specified by:
topicSource
in interfaceReplicationPolicy
-
upstreamTopic
Description copied from interface:ReplicationPolicy
Return 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:
upstreamTopic
in interfaceReplicationPolicy
-
offsetSyncsTopic
Description copied from interface:ReplicationPolicy
Returns the name of the offset-syncs topic for given cluster alias.- Specified by:
offsetSyncsTopic
in interfaceReplicationPolicy
-
checkpointsTopic
Description copied from interface:ReplicationPolicy
Returns the name of the checkpoints topic for given cluster alias.- Specified by:
checkpointsTopic
in interfaceReplicationPolicy
-
isCheckpointsTopic
Description copied from interface:ReplicationPolicy
Returns true if the topic is a checkpoints topic.- Specified by:
isCheckpointsTopic
in interfaceReplicationPolicy
-
isMM2InternalTopic
Description copied from interface:ReplicationPolicy
Returns 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:
isMM2InternalTopic
in interfaceReplicationPolicy
-