public class IdentityReplicationPolicy extends DefaultReplicationPolicy
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.
| Modifier and Type | Field and Description |
|---|---|
static String |
SOURCE_CLUSTER_ALIAS_CONFIG |
INTERNAL_TOPIC_SEPARATOR_ENABLED_CONFIG, INTERNAL_TOPIC_SEPARATOR_ENABLED_DEFAULT, SEPARATOR_CONFIG, SEPARATOR_DEFAULT| Constructor and Description |
|---|
IdentityReplicationPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Map<String,?> props) |
String |
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, IdentityReplicationPolicy 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`.
|
checkpointsTopic, isCheckpointsTopic, isMM2InternalTopic, offsetSyncsTopicequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitheartbeatsTopic, isHeartbeatsTopic, isInternalTopic, originalTopicpublic static final String SOURCE_CLUSTER_ALIAS_CONFIG
public void configure(Map<String,?> props)
configure in interface org.apache.kafka.common.Configurableconfigure in class DefaultReplicationPolicypublic String formatRemoteTopic(String sourceClusterAlias, String topic)
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.formatRemoteTopic(String, String).
formatRemoteTopic in interface ReplicationPolicyformatRemoteTopic in class DefaultReplicationPolicypublic String topicSource(String topic)
DefaultReplicationPolicy, IdentityReplicationPolicy cannot know the source of
a remote topic based on its name alone. If source.cluster.alias is provided,
this method will return that.
In the special case of heartbeats, we defer to DefaultReplicationPolicy.topicSource(String).
topicSource in interface ReplicationPolicytopicSource in class DefaultReplicationPolicypublic String upstreamTopic(String topic)
In the special case of heartbeats, we defer to DefaultReplicationPolicy.upstreamTopic(String).
upstreamTopic in interface ReplicationPolicyupstreamTopic in class DefaultReplicationPolicy