public class HttpLookupService extends Object implements LookupService
| Constructor and Description |
|---|
HttpLookupService(ClientConfigurationData conf,
io.netty.channel.EventLoopGroup eventLoopGroup) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> |
getBroker(TopicName topicName)
Calls http-lookup api to find broker-service address which can serve a given topic.
|
CompletableFuture<PartitionedTopicMetadata> |
getPartitionedTopicMetadata(TopicName topicName)
Returns
PartitionedTopicMetadata for a given 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 HttpLookupService(ClientConfigurationData conf, io.netty.channel.EventLoopGroup eventLoopGroup) 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)
LookupServicePartitionedTopicMetadata for a given topic.getPartitionedTopicMetadata in interface LookupServicetopicName - topic-namepublic String getServiceUrl()
LookupServicegetServiceUrl in interface LookupServicepublic CompletableFuture<List<String>> getTopicsUnderNamespace(NamespaceName namespace, PulsarApi.CommandGetTopicsOfNamespace.Mode mode)
LookupServicegetTopicsUnderNamespace in interface LookupServicenamespace - : namespace-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 void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2017–2020 Apache Software Foundation. All rights reserved.