public class BinaryProtoLookupService extends Object implements LookupService
| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryProtoLookupService.LookupDataResult |
| Modifier and Type | Field and Description |
|---|---|
protected InetSocketAddress |
serviceAddress |
| Constructor and Description |
|---|
BinaryProtoLookupService(PulsarClientImpl client,
String serviceUrl,
boolean useTls,
ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> |
getBroker(TopicName topicName)
Calls broker binaryProto-lookup api to find broker-service address which can serve a given topic.
|
CompletableFuture<PartitionedTopicMetadata> |
getPartitionedTopicMetadata(TopicName topicName)
calls broker binaryProto-lookup api to get metadata of partitioned-topic.
|
CompletableFuture<Optional<SchemaInfo>> |
getSchema(TopicName topicName) |
String |
getServiceUrl()
Returns broker-service lookup api url.
|
CompletableFuture<List<String>> |
getTopicsUnderNamespace(NamespaceName namespace,
PulsarApi.CommandGetTopicsOfNamespace.Mode mode)
Returns all the topics name for a given namespace.
|
void |
updateServiceUrl(String serviceUrl)
Instruct the LookupService to switch to a new service URL for all subsequent requests
|
protected volatile InetSocketAddress serviceAddress
public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, boolean useTls, ExecutorService executor) throws PulsarClientException
PulsarClientExceptionpublic void updateServiceUrl(String serviceUrl) throws PulsarClientException
LookupServiceupdateServiceUrl in interface LookupServicePulsarClientExceptionpublic CompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> getBroker(TopicName topicName)
getBroker in interface LookupServicetopicName - topic-namepublic CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(TopicName topicName)
getPartitionedTopicMetadata in interface LookupServicetopicName - topic-namepublic CompletableFuture<Optional<SchemaInfo>> getSchema(TopicName topicName)
getSchema in interface LookupServicepublic String getServiceUrl()
LookupServicegetServiceUrl in interface LookupServicepublic CompletableFuture<List<String>> getTopicsUnderNamespace(NamespaceName namespace, PulsarApi.CommandGetTopicsOfNamespace.Mode mode)
LookupServicegetTopicsUnderNamespace in interface LookupServicenamespace - : namespace-namepublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2017–2018 Apache Software Foundation. All rights reserved.