public class MirrorClient extends Object implements AutoCloseable
RemoteClusterUtils instead of directly using MirrorClient.| Constructor and Description |
|---|
MirrorClient(Map<String,Object> props) |
MirrorClient(MirrorClientConfig config) |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
checkpointTopics()
Finds all checkpoints topics on this cluster.
|
void |
close()
Closes internal clients.
|
Set<String> |
heartbeatTopics()
Finds all heartbeats topics on this cluster.
|
Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> |
remoteConsumerOffsets(String consumerGroupId,
String remoteClusterAlias,
Duration timeout)
Translates a remote consumer group's offsets into corresponding local offsets.
|
Set<String> |
remoteTopics()
Finds all remote topics on this cluster.
|
Set<String> |
remoteTopics(String source)
Finds all remote topics that have been replicated directly from the given source cluster.
|
int |
replicationHops(String upstreamClusterAlias)
Computes the shortest number of hops from an upstream source cluster.
|
ReplicationPolicy |
replicationPolicy()
Gets the
ReplicationPolicy instance used to interpret remote topics. |
Set<String> |
upstreamClusters()
Finds upstream clusters, which may be multiple hops away, based on incoming heartbeats.
|
public MirrorClient(MirrorClientConfig config)
public void close()
close in interface AutoCloseablepublic ReplicationPolicy replicationPolicy()
ReplicationPolicy instance used to interpret remote topics. This instance is constructed based on
relevant configuration properties, including replication.policy.class.public int replicationHops(String upstreamClusterAlias) throws InterruptedException
InterruptedExceptionpublic Set<String> heartbeatTopics() throws InterruptedException
InterruptedExceptionpublic Set<String> checkpointTopics() throws InterruptedException
InterruptedExceptionpublic Set<String> upstreamClusters() throws InterruptedException
InterruptedExceptionpublic Set<String> remoteTopics() throws InterruptedException
InterruptedExceptionpublic Set<String> remoteTopics(String source) throws InterruptedException
InterruptedExceptionpublic Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> remoteConsumerOffsets(String consumerGroupId, String remoteClusterAlias, Duration timeout)
consumerGroupId - The group ID of remote consumer groupremoteClusterAlias - The alias of remote clustertimeout - The maximum time to block when consuming from the checkpoints topic