public class BinaryProtoLookupService extends Object implements LookupService
| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryProtoLookupService.LookupDataResult |
| Constructor and Description |
|---|
BinaryProtoLookupService(PulsarClientImpl client,
String serviceUrl,
boolean useTls,
ExecutorService executor) |
BinaryProtoLookupService(PulsarClientImpl client,
String serviceUrl,
String listenerName,
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)
Returns current SchemaInfo
SchemaInfo for a given topic. |
CompletableFuture<Optional<SchemaInfo>> |
getSchema(TopicName topicName,
byte[] version)
Returns specific version SchemaInfo
SchemaInfo for a given topic. |
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
|
public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, boolean useTls, ExecutorService executor) throws PulsarClientException
PulsarClientExceptionpublic BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, 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)
LookupServiceSchemaInfo for a given topic.getSchema in interface LookupServicetopicName - topic-namepublic CompletableFuture<Optional<SchemaInfo>> getSchema(TopicName topicName, byte[] version)
LookupServiceSchemaInfo for a given topic.getSchema in interface LookupServicetopicName - topic-nameversion - schema info versionpublic 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–2020 Apache Software Foundation. All rights reserved.