Class TopicLookupBase

java.lang.Object
org.apache.pulsar.broker.web.PulsarWebResource
org.apache.pulsar.broker.lookup.TopicLookupBase
Direct Known Subclasses:
TopicLookup, TopicLookup

public class TopicLookupBase extends PulsarWebResource
  • Constructor Details

    • TopicLookupBase

      public TopicLookupBase()
  • Method Details

    • internalLookupTopicAsync

      protected CompletableFuture<org.apache.pulsar.common.lookup.data.LookupData> internalLookupTopicAsync(org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String listenerName)
    • internalGetNamespaceBundle

      protected String internalGetNamespaceBundle(org.apache.pulsar.common.naming.TopicName topicName)
    • lookupTopicAsync

      public static CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId)
      Lookup broker-service address for a given namespace-bundle which contains given topic. a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives lookup-request and if it's not a leader then current broker redirects request to leader by returning leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the namespace-bundle then it owns a bundle and returns success(connect) response to client.
      Parameters:
      pulsarService -
      topicName -
      authoritative -
      clientAppId -
      requestId -
      Returns:
    • lookupTopicAsync

      public static CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync(PulsarService pulsarService, org.apache.pulsar.common.naming.TopicName topicName, boolean authoritative, String clientAppId, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData, long requestId, String advertisedListenerName)
      Lookup broker-service address for a given namespace-bundle which contains given topic. a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives lookup-request and if it's not a leader then current broker redirects request to leader by returning leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the namespace-bundle then it owns a bundle and returns success(connect) response to client.
      Parameters:
      pulsarService -
      topicName -
      authoritative -
      clientAppId -
      requestId -
      advertisedListenerName -
      Returns:
    • getTopicName

      protected org.apache.pulsar.common.naming.TopicName getTopicName(String topicDomain, String tenant, String cluster, String namespace, @Encoded String encodedTopic)
    • getTopicName

      protected org.apache.pulsar.common.naming.TopicName getTopicName(String topicDomain, String tenant, String namespace, @Encoded String encodedTopic)