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
Fields inherited from class org.apache.kafka.connect.mirror.DefaultReplicationPolicy
SEPARATOR_CONFIG, SEPARATOR_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Configure 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, offsetSyncsTopic
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in 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:
formatRemoteTopic
in interfaceReplicationPolicy
- Overrides:
formatRemoteTopic
in 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:
topicSource
in interfaceReplicationPolicy
- Overrides:
topicSource
in 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:
upstreamTopic
in interfaceReplicationPolicy
- Overrides:
upstreamTopic
in classDefaultReplicationPolicy
-