Package org.apache.kafka.connect.mirror
Class RemoteClusterUtils
java.lang.Object
org.apache.kafka.connect.mirror.RemoteClusterUtils
Convenience tool for multi-cluster environments. Wraps 
MirrorClient
 
 Properties passed to these methods are used to construct internal Admin and Consumer clients.
 Sub-configs like "admin.xyz" are also supported. For example:
 
     bootstrap.servers = host1:9092
     consumer.client.id = mm2-client
 
 - 
Method SummaryModifier and TypeMethodDescriptioncheckpointTopics(Map<String, Object> properties) Finds all checkpoints topicsheartbeatTopics(Map<String, Object> properties) Finds all heartbeats topicsstatic intreplicationHops(Map<String, Object> properties, String upstreamClusterAlias) Finds the shortest number of hops from an upstream cluster.static Map<TopicPartition,OffsetAndMetadata> translateOffsets(Map<String, Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) Translates a remote consumer group's offsets into corresponding local offsets.upstreamClusters(Map<String, Object> properties) Finds all upstream clusters
- 
Method Details- 
replicationHopspublic static int replicationHops(Map<String, Object> properties, String upstreamClusterAlias) throws InterruptedException, TimeoutExceptionFinds the shortest number of hops from an upstream cluster. Returns -1 if the cluster is unreachable.- Throws:
- InterruptedException
- TimeoutException
 
- 
heartbeatTopicspublic static Set<String> heartbeatTopics(Map<String, Object> properties) throws InterruptedException, TimeoutExceptionFinds all heartbeats topics- Throws:
- InterruptedException
- TimeoutException
 
- 
checkpointTopicspublic static Set<String> checkpointTopics(Map<String, Object> properties) throws InterruptedException, TimeoutExceptionFinds all checkpoints topics- Throws:
- InterruptedException
- TimeoutException
 
- 
upstreamClusterspublic static Set<String> upstreamClusters(Map<String, Object> properties) throws InterruptedException, TimeoutExceptionFinds all upstream clusters- Throws:
- InterruptedException
- TimeoutException
 
- 
translateOffsetspublic static Map<TopicPartition,OffsetAndMetadata> translateOffsets(Map<String, Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) throws InterruptedException, TimeoutExceptionTranslates a remote consumer group's offsets into corresponding local offsets. Topics are automatically renamed according to the configuredReplicationPolicy.- Parameters:
- properties- Map of properties to instantiate a- MirrorClient
- remoteClusterAlias- The alias of the remote cluster
- consumerGroupId- The group ID of remote consumer group
- timeout- The maximum time to block when consuming from the checkpoints topic
- Throws:
- InterruptedException
- TimeoutException
 
 
-