Class TopicLookupBase

    • Constructor Detail

      • TopicLookupBase

        public TopicLookupBase()
    • Method Detail

      • internalLookupTopicAsync

        protected void internalLookupTopicAsync​(org.apache.pulsar.common.naming.TopicName topicName,
                                                boolean authoritative,
                                                javax.ws.rs.container.AsyncResponse asyncResponse,
                                                java.lang.String listenerName)
      • internalGetNamespaceBundle

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

        public static java.util.concurrent.CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync​(PulsarService pulsarService,
                                                                                                       org.apache.pulsar.common.naming.TopicName topicName,
                                                                                                       boolean authoritative,
                                                                                                       java.lang.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 java.util.concurrent.CompletableFuture<io.netty.buffer.ByteBuf> lookupTopicAsync​(PulsarService pulsarService,
                                                                                                       org.apache.pulsar.common.naming.TopicName topicName,
                                                                                                       boolean authoritative,
                                                                                                       java.lang.String clientAppId,
                                                                                                       org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData,
                                                                                                       long requestId,
                                                                                                       java.lang.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​(java.lang.String topicDomain,
                                                                         java.lang.String tenant,
                                                                         java.lang.String cluster,
                                                                         java.lang.String namespace,
                                                                         @Encoded
                                                                         java.lang.String encodedTopic)
      • getTopicName

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