Package org.apache.kafka.connect.mirror
Class RemoteClusterUtils
java.lang.Object
org.apache.kafka.connect.mirror.RemoteClusterUtils
Convenience methods 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) Find all checkpoint topicsheartbeatTopics(Map<String, Object> properties) Find all heartbeat topicsstatic intreplicationHops(Map<String, Object> properties, String upstreamClusterAlias) Find shortest number of hops from an upstream cluster.static Map<TopicPartition,OffsetAndMetadata> translateOffsets(Map<String, Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) Translate a remote consumer group's offsets into corresponding local offsets.upstreamClusters(Map<String, Object> properties) Find all upstream clusters
- 
Method Details- 
replicationHopspublic static int replicationHops(Map<String, Object> properties, String upstreamClusterAlias) throws InterruptedException, TimeoutExceptionFind 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, TimeoutExceptionFind all heartbeat topics- Throws:
- InterruptedException
- TimeoutException
 
- 
checkpointTopicspublic static Set<String> checkpointTopics(Map<String, Object> properties) throws InterruptedException, TimeoutExceptionFind all checkpoint topics- Throws:
- InterruptedException
- TimeoutException
 
- 
upstreamClusterspublic static Set<String> upstreamClusters(Map<String, Object> properties) throws InterruptedException, TimeoutExceptionFind all upstream clusters- Throws:
- InterruptedException
- TimeoutException
 
- 
translateOffsetspublic static Map<TopicPartition,OffsetAndMetadata> translateOffsets(Map<String, Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) throws InterruptedException, TimeoutExceptionTranslate a remote consumer group's offsets into corresponding local offsets. Topics are automatically renamed according to the ReplicationPolicy.- Parameters:
- properties-- MirrorClientConfigproperties to instantiate a- MirrorClient
- consumerGroupId- group ID of remote consumer group
- remoteClusterAlias- alias of remote cluster
- timeout- timeout
- Throws:
- InterruptedException
- TimeoutException
 
 
-