Package org.apache.kafka.connect.mirror
Class IdentityReplicationPolicy
java.lang.Object
org.apache.kafka.connect.mirror.DefaultReplicationPolicy
org.apache.kafka.connect.mirror.IdentityReplicationPolicy
- All Implemented Interfaces:
Configurable,ReplicationPolicy
Alternative implementation of
ReplicationPolicy that does not rename remote topics.
This is useful for migrating from legacy MirrorMaker, or for any use-case involving one-way replication.
N.B. MirrorMaker is not able to prevent cycles when using this replication policy, so take care that your replication topology is acyclic. If migrating from legacy MirrorMaker, this will likely already be the case.
-
Field Summary
FieldsFields inherited from class org.apache.kafka.connect.mirror.DefaultReplicationPolicy
INTERNAL_TOPIC_SEPARATOR_ENABLED_CONFIG, INTERNAL_TOPIC_SEPARATOR_ENABLED_DEFAULT, SEPARATOR_CONFIG, SEPARATOR_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this class with the given key-value pairsformatRemoteTopic(String sourceClusterAlias, String topic) UnlikeDefaultReplicationPolicy, IdentityReplicationPolicy does not include the source cluster alias in the remote topic name.topicSource(String topic) UnlikeDefaultReplicationPolicy, IdentityReplicationPolicy cannot know the source of a remote topic based on its name alone.upstreamTopic(String topic) Since any topic may be a remote topic, this just returns `topic`.Methods inherited from class org.apache.kafka.connect.mirror.DefaultReplicationPolicy
checkpointsTopic, isCheckpointsTopic, isMM2InternalTopic, offsetSyncsTopicMethods 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
-
SOURCE_CLUSTER_ALIAS_CONFIG
- See Also:
-
-
Constructor Details
-
IdentityReplicationPolicy
public IdentityReplicationPolicy()
-
-
Method Details
-
configure
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classDefaultReplicationPolicy
-
formatRemoteTopic
UnlikeDefaultReplicationPolicy, IdentityReplicationPolicy does not include the source cluster alias in the remote topic name. Instead, topic names are unchanged.In the special case of heartbeats, we defer to
DefaultReplicationPolicy.formatRemoteTopic(String, String).- Specified by:
formatRemoteTopicin interfaceReplicationPolicy- Overrides:
formatRemoteTopicin classDefaultReplicationPolicy
-
topicSource
UnlikeDefaultReplicationPolicy, IdentityReplicationPolicy cannot know the source of a remote topic based on its name alone. Ifsource.cluster.aliasis provided, this method will return that.In the special case of heartbeats, we defer to
DefaultReplicationPolicy.topicSource(String).- Specified by:
topicSourcein interfaceReplicationPolicy- Overrides:
topicSourcein classDefaultReplicationPolicy
-
upstreamTopic
Since any topic may be a remote topic, this just returns `topic`.In the special case of heartbeats, we defer to
DefaultReplicationPolicy.upstreamTopic(String).- Specified by:
upstreamTopicin interfaceReplicationPolicy- Overrides:
upstreamTopicin classDefaultReplicationPolicy
-