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, wait
heartbeatsTopic, isHeartbeatsTopic, isInternalTopic, originalTopic
public 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)
Configurable
configure
in interface Configurable
public String formatRemoteTopic(String sourceClusterAlias, String topic)
ReplicationPolicy
formatRemoteTopic
in interface ReplicationPolicy
public String topicSource(String topic)
ReplicationPolicy
topicSource
in interface ReplicationPolicy
public String upstreamTopic(String topic)
ReplicationPolicy
Topics 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 ReplicationPolicy
public String offsetSyncsTopic(String clusterAlias)
ReplicationPolicy
offsetSyncsTopic
in interface ReplicationPolicy
public String checkpointsTopic(String clusterAlias)
ReplicationPolicy
checkpointsTopic
in interface ReplicationPolicy
public boolean isCheckpointsTopic(String topic)
ReplicationPolicy
isCheckpointsTopic
in interface ReplicationPolicy
public boolean isMM2InternalTopic(String topic)
ReplicationPolicy
isMM2InternalTopic
in interface ReplicationPolicy