public final class RemoteClusterUtils extends Object
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
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
checkpointTopics(Map<String,Object> properties)
Finds all checkpoints topics
|
static Set<String> |
heartbeatTopics(Map<String,Object> properties)
Finds all heartbeats topics
|
static int |
replicationHops(Map<String,Object> properties,
String upstreamClusterAlias)
Finds the shortest number of hops from an upstream cluster.
|
static Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> |
translateOffsets(Map<String,Object> properties,
String remoteClusterAlias,
String consumerGroupId,
Duration timeout)
Translates a remote consumer group's offsets into corresponding local offsets.
|
static Set<String> |
upstreamClusters(Map<String,Object> properties)
Finds all upstream clusters
|
public static int replicationHops(Map<String,Object> properties, String upstreamClusterAlias) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic static Set<String> heartbeatTopics(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic static Set<String> checkpointTopics(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic static Set<String> upstreamClusters(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic static Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> translateOffsets(Map<String,Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) throws InterruptedException, TimeoutException
ReplicationPolicy.properties - Map of properties to instantiate a MirrorClientremoteClusterAlias - The alias of the remote clusterconsumerGroupId - The group ID of remote consumer grouptimeout - The maximum time to block when consuming from the checkpoints topicInterruptedExceptionTimeoutException