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
IdentityReplicationPolicy does not rename remote topics. This is useful for migrating
from legacy MM1, or for any use-case involving one-way replication.
N.B. MirrorMaker is not able to prevent cycles when using this class, so take care that
your replication topology is acyclic. If migrating from MirrorMaker v1, this will likely
already be the case.
-
Field Summary
FieldsFields inherited from class org.apache.kafka.connect.mirror.DefaultReplicationPolicy
SEPARATOR_CONFIG, SEPARATOR_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this class with the given key-value pairsformatRemoteTopic(String sourceClusterAlias, String topic) Unlike DefaultReplicationPolicy, IdentityReplicationPolicy does not include the source cluster alias in the remote topic name.topicSource(String topic) Unlike DefaultReplicationPolicy, 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
clone, equals, finalize, 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
Unlike DefaultReplicationPolicy, 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.- Specified by:
formatRemoteTopicin interfaceReplicationPolicy- Overrides:
formatRemoteTopicin classDefaultReplicationPolicy
-
topicSource
Unlike DefaultReplicationPolicy, IdentityReplicationPolicy cannot know the source of a remote topic based on its name alone. If `source.cluster.alias` is provided, `topicSource` will return that. In the special case of heartbeats, we defer to DefaultReplicationPolicy.- 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.- Specified by:
upstreamTopicin interfaceReplicationPolicy- Overrides:
upstreamTopicin classDefaultReplicationPolicy
-