Package org.apache.pulsar.client.impl
Interface LookupService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BinaryProtoLookupService,HttpLookupService
Provides lookup service to find broker which serves given topic. It helps to
lookup
- topic-lookup: lookup to find broker-address which serves given topic
- Partitioned-topic-Metadata-lookup: lookup to find PartitionedMetadata for a given topic
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> Calls broker lookup-api to get brokerInetSocketAddresswhich serves namespace bundle that contains given topic.CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata>getPartitionedTopicMetadata(TopicName topicName) ReturnsPartitionedTopicMetadatafor a given topic.Returns current SchemaInfoSchemaInfofor a given topic.Returns specific version SchemaInfoSchemaInfofor a given topic.Returns broker-service lookup api url.getTopicsUnderNamespace(NamespaceName namespace, CommandGetTopicsOfNamespace.Mode mode, String topicPattern, String topicsHash) Returns all the topics name for a given namespace.Resolves pulsar service url.voidupdateServiceUrl(String serviceUrl) Instruct the LookupService to switch to a new service URL for all subsequent requests.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
updateServiceUrl
Instruct the LookupService to switch to a new service URL for all subsequent requests.- Throws:
PulsarClientException
-
getBroker
CompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> getBroker(TopicName topicName) Calls broker lookup-api to get brokerInetSocketAddresswhich serves namespace bundle that contains given topic.- Parameters:
topicName- topic-name- Returns:
- a pair of addresses, representing the logical and physical address of the broker that serves given topic
-
getPartitionedTopicMetadata
CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadata(TopicName topicName) ReturnsPartitionedTopicMetadatafor a given topic.- Parameters:
topicName- topic-name- Returns:
-
getSchema
Returns current SchemaInfoSchemaInfofor a given topic.- Parameters:
topicName- topic-name- Returns:
- SchemaInfo
-
getSchema
Returns specific version SchemaInfoSchemaInfofor a given topic.- Parameters:
topicName- topic-nameversion- schema info version- Returns:
- SchemaInfo
-
getServiceUrl
String getServiceUrl()Returns broker-service lookup api url.- Returns:
-
resolveHost
InetSocketAddress resolveHost()Resolves pulsar service url.- Returns:
- the service url resolved to a socket address
-
getTopicsUnderNamespace
CompletableFuture<GetTopicsResult> getTopicsUnderNamespace(NamespaceName namespace, CommandGetTopicsOfNamespace.Mode mode, String topicPattern, String topicsHash) Returns all the topics name for a given namespace.- Parameters:
namespace- : namespace-name- Returns:
-