public final class RemoteClusterUtils
extends java.lang.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 java.util.Set<java.lang.String> |
checkpointTopics(java.util.Map<java.lang.String,java.lang.Object> properties)
Find all checkpoint topics
|
static java.util.Set<java.lang.String> |
heartbeatTopics(java.util.Map<java.lang.String,java.lang.Object> properties)
Find all heartbeat topics
|
static int |
replicationHops(java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.String upstreamClusterAlias)
Find shortest number of hops from an upstream cluster.
|
static java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> |
translateOffsets(java.util.Map<java.lang.String,java.lang.Object> properties,
java.lang.String remoteClusterAlias,
java.lang.String consumerGroupId,
java.time.Duration timeout)
Translate a remote consumer group's offsets into corresponding local offsets.
|
static java.util.Set<java.lang.String> |
upstreamClusters(java.util.Map<java.lang.String,java.lang.Object> properties)
Find all upstream clusters
|
public static int replicationHops(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String upstreamClusterAlias) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public static java.util.Set<java.lang.String> heartbeatTopics(java.util.Map<java.lang.String,java.lang.Object> properties) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public static java.util.Set<java.lang.String> checkpointTopics(java.util.Map<java.lang.String,java.lang.Object> properties) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public static java.util.Set<java.lang.String> upstreamClusters(java.util.Map<java.lang.String,java.lang.Object> properties) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public static java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> translateOffsets(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String remoteClusterAlias, java.lang.String consumerGroupId, java.time.Duration timeout) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
properties
- @see MirrorClientConfigconsumerGroupId
- group ID of remote consumer groupremoteClusterAlias
- alias of remote clustertimeout
- timeoutjava.lang.InterruptedException
java.util.concurrent.TimeoutException