Package org.apache.pulsar.client.impl
Class BinaryProtoLookupService
java.lang.Object
org.apache.pulsar.client.impl.BinaryProtoLookupService
- All Implemented Interfaces:
AutoCloseable,LookupService
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, boolean useTls, ExecutorService executor) BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()CompletableFuture<org.apache.commons.lang3.tuple.Pair<InetSocketAddress,InetSocketAddress>> Calls broker binaryProto-lookup api to find broker-service address which can serve a given topic.CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata>getPartitionedTopicMetadata(TopicName topicName) calls broker binaryProto-lookup api to get metadata of partitioned-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 topicsPattern, 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.
-
Constructor Details
-
BinaryProtoLookupService
public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, boolean useTls, ExecutorService executor) throws PulsarClientException - Throws:
PulsarClientException
-
BinaryProtoLookupService
public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService executor) throws PulsarClientException - Throws:
PulsarClientException
-
-
Method Details
-
updateServiceUrl
Description copied from interface:LookupServiceInstruct the LookupService to switch to a new service URL for all subsequent requests.- Specified by:
updateServiceUrlin interfaceLookupService- Throws:
PulsarClientException
-
getBroker
public 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.- Specified by:
getBrokerin interfaceLookupService- Parameters:
topicName- topic-name- Returns:
- broker-socket-address that serves given topic
-
getPartitionedTopicMetadata
public CompletableFuture<org.apache.pulsar.common.partition.PartitionedTopicMetadata> getPartitionedTopicMetadata(TopicName topicName) calls broker binaryProto-lookup api to get metadata of partitioned-topic.- Specified by:
getPartitionedTopicMetadatain interfaceLookupService- Parameters:
topicName- topic-name- Returns:
-
getSchema
Description copied from interface:LookupServiceReturns current SchemaInfoSchemaInfofor a given topic.- Specified by:
getSchemain interfaceLookupService- Parameters:
topicName- topic-name- Returns:
- SchemaInfo
-
getSchema
Description copied from interface:LookupServiceReturns specific version SchemaInfoSchemaInfofor a given topic.- Specified by:
getSchemain interfaceLookupService- Parameters:
topicName- topic-nameversion- schema info version- Returns:
- SchemaInfo
-
getServiceUrl
Description copied from interface:LookupServiceReturns broker-service lookup api url.- Specified by:
getServiceUrlin interfaceLookupService- Returns:
-
resolveHost
Description copied from interface:LookupServiceResolves pulsar service url.- Specified by:
resolveHostin interfaceLookupService- Returns:
- the service url resolved to a socket address
-
getTopicsUnderNamespace
public CompletableFuture<GetTopicsResult> getTopicsUnderNamespace(NamespaceName namespace, CommandGetTopicsOfNamespace.Mode mode, String topicsPattern, String topicsHash) Description copied from interface:LookupServiceReturns all the topics name for a given namespace.- Specified by:
getTopicsUnderNamespacein interfaceLookupService- Parameters:
namespace- : namespace-name- Returns:
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-