Class BrokerDiscoveryProvider

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    @Evolving
    @LimitedPrivate
    public class BrokerDiscoveryProvider
    extends java.lang.Object
    implements java.io.Closeable
    Maintains available active broker list and returns next active broker in round-robin for discovery service. This is an API used by Proxy Extensions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkAuthorization​(ProxyService service, org.apache.pulsar.common.naming.TopicName topicName, java.lang.String role, org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData)  
      void close()  
      java.util.List<? extends org.apache.pulsar.policies.data.loadbalancer.ServiceLookupData> getAvailableBrokers()
      Access the list of available brokers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BrokerDiscoveryProvider

        public BrokerDiscoveryProvider​(ProxyConfiguration config,
                                       org.apache.pulsar.broker.resources.PulsarResources pulsarResources)
                                throws org.apache.pulsar.broker.PulsarServerException
        Throws:
        org.apache.pulsar.broker.PulsarServerException
    • Method Detail

      • getAvailableBrokers

        public java.util.List<? extends org.apache.pulsar.policies.data.loadbalancer.ServiceLookupData> getAvailableBrokers()
                                                                                                                     throws org.apache.pulsar.broker.PulsarServerException
        Access the list of available brokers. Used by Protocol Handlers
        Returns:
        the list of available brokers
        Throws:
        org.apache.pulsar.broker.PulsarServerException
      • checkAuthorization

        protected void checkAuthorization​(ProxyService service,
                                          org.apache.pulsar.common.naming.TopicName topicName,
                                          java.lang.String role,
                                          org.apache.pulsar.broker.authentication.AuthenticationDataSource authenticationData)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException