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 scheduleExecutor) Deprecated.BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService scheduleExecutor) BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService scheduleExecutor, ExecutorService lookupPinnedExecutor) -
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, boolean metadataAutoCreationEnabled, boolean useFallbackForNonPIP344Brokers) 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 that matches 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.client.impl.LookupService
getPartitionedTopicMetadata, getPartitionedTopicMetadata
-
Constructor Details
-
BinaryProtoLookupService
@Deprecated public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, boolean useTls, ExecutorService scheduleExecutor) throws PulsarClientException Deprecated.- Throws:
PulsarClientException
-
BinaryProtoLookupService
@Deprecated public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService scheduleExecutor) throws PulsarClientException Deprecated.- Throws:
PulsarClientException
-
BinaryProtoLookupService
public BinaryProtoLookupService(PulsarClientImpl client, String serviceUrl, String listenerName, boolean useTls, ExecutorService scheduleExecutor, ExecutorService lookupPinnedExecutor) 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, boolean metadataAutoCreationEnabled, boolean useFallbackForNonPIP344Brokers) calls broker binaryProto-lookup api to get metadata of partitioned-topic.- Specified by:
getPartitionedTopicMetadatain interfaceLookupServiceuseFallbackForNonPIP344Brokers-If true, fallback to the prior behavior of the method
LookupService.getPartitionedTopicMetadata(TopicName)if the broker does not support the PIP-344 feature 'supports_get_partitioned_metadata_without_auto_creation'. This parameter only affects the behavior when is false.
-
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 that matches for a given namespace. Note: it relate to the topic name(without the partition suffix). For example: - There is a partitioned topic "tp-a" with two partitions. - tp-a-partition-0 - tp-a-partition-1 - If is "tp-a", the consumer will subscribe to the two partitions. - if is "tp-a-partition-0", the consumer will subscribe nothing.- Specified by:
getTopicsUnderNamespacein interfaceLookupService- Parameters:
namespace- : namespace-name- Returns:
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
BinaryProtoLookupService(PulsarClientImpl, String, String, boolean, ExecutorService, ExecutorService)instead.