public class DefaultReplicationPolicy extends Object implements ReplicationPolicy, Configurable
| Modifier and Type | Field and Description |
|---|---|
static String |
INTERNAL_TOPIC_SEPARATOR_ENABLED_CONFIG |
static Boolean |
INTERNAL_TOPIC_SEPARATOR_ENABLED_DEFAULT |
static String |
SEPARATOR_CONFIG |
static String |
SEPARATOR_DEFAULT |
| Constructor and Description |
|---|
DefaultReplicationPolicy() |
| Modifier and Type | Method and Description |
|---|---|
String |
checkpointsTopic(String clusterAlias)
Returns the name checkpoint topic for given cluster alias.
|
void |
configure(Map<String,?> props)
Configure this class with the given key-value pairs
|
String |
formatRemoteTopic(String sourceClusterAlias,
String topic)
How to rename remote topics; generally should be like us-west.topic1.
|
boolean |
isCheckpointsTopic(String topic)
check if topic is a checkpoint topic.
|
boolean |
isMM2InternalTopic(String topic)
Check topic is one of MM2 internal topic, this is used to make sure the topic doesn't need to be replicated.
|
String |
offsetSyncsTopic(String clusterAlias)
Returns the offset-syncs topic for given cluster alias.
|
String |
topicSource(String topic)
Source cluster alias of given remote topic, e.g.
|
String |
upstreamTopic(String topic)
Name of topic on the source cluster, e.g.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitheartbeatsTopic, isHeartbeatsTopic, isInternalTopic, originalTopicpublic static final String SEPARATOR_CONFIG
public static final String SEPARATOR_DEFAULT
public static final String INTERNAL_TOPIC_SEPARATOR_ENABLED_CONFIG
public static final Boolean INTERNAL_TOPIC_SEPARATOR_ENABLED_DEFAULT
public void configure(Map<String,?> props)
Configurableconfigure in interface Configurablepublic String formatRemoteTopic(String sourceClusterAlias, String topic)
ReplicationPolicyformatRemoteTopic in interface ReplicationPolicypublic String topicSource(String topic)
ReplicationPolicytopicSource in interface ReplicationPolicypublic String upstreamTopic(String topic)
ReplicationPolicyTopics may be replicated multiple hops, so the immediately upstream topic may itself be a remote topic.
Returns null if not a remote topic.
upstreamTopic in interface ReplicationPolicypublic String offsetSyncsTopic(String clusterAlias)
ReplicationPolicyoffsetSyncsTopic in interface ReplicationPolicypublic String checkpointsTopic(String clusterAlias)
ReplicationPolicycheckpointsTopic in interface ReplicationPolicypublic boolean isCheckpointsTopic(String topic)
ReplicationPolicyisCheckpointsTopic in interface ReplicationPolicypublic boolean isMM2InternalTopic(String topic)
ReplicationPolicyisMM2InternalTopic in interface ReplicationPolicy