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
public class IdentityReplicationPolicy extends DefaultReplicationPolicy
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 Modifier and Type Field Description static String
SOURCE_CLUSTER_ALIAS_CONFIG
Fields inherited from class org.apache.kafka.connect.mirror.DefaultReplicationPolicy
SEPARATOR_CONFIG, SEPARATOR_DEFAULT
-
Constructor Summary
Constructors Constructor Description IdentityReplicationPolicy()
-
Method Summary
Modifier and Type Method Description void
configure(Map<String,?> props)
Configure this class with the given key-value pairsString
formatRemoteTopic(String sourceClusterAlias, String topic)
Unlike DefaultReplicationPolicy, IdentityReplicationPolicy does not include the source cluster alias in the remote topic name.String
topicSource(String topic)
Unlike DefaultReplicationPolicy, IdendityReplicationPolicy cannot know the source of a remote topic based on its name alone.String
upstreamTopic(String topic)
Since any topic may be a "remote topic", this just returns `topic`.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
isInternalTopic, originalTopic
-
Field Details
-
SOURCE_CLUSTER_ALIAS_CONFIG
- See Also:
- Constant Field Values
-
-
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, IdendityReplicationPolicy 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
-