public final class RemoteClusterUtils extends Object
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)
Find all checkpoint topics
|
static Set<String> |
heartbeatTopics(Map<String,Object> properties)
Find all heartbeat topics
|
static int |
replicationHops(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.
|
static Set<String> |
upstreamClusters(Map<String,Object> properties)
Find all upstream clusters
|
public static int replicationHops(Map<String,Object> properties, String upstreamClusterAlias) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
public static Set<String> heartbeatTopics(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
public static Set<String> checkpointTopics(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
public static Set<String> upstreamClusters(Map<String,Object> properties) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
public static Map<TopicPartition,OffsetAndMetadata> translateOffsets(Map<String,Object> properties, String remoteClusterAlias, String consumerGroupId, Duration timeout) throws InterruptedException, TimeoutException
properties
- @see MirrorClientConfigconsumerGroupId
- group ID of remote consumer groupremoteClusterAlias
- alias of remote clustertimeout
- timeoutInterruptedException
TimeoutException