Class MetadataStoreCacheLoader

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

    public class MetadataStoreCacheLoader
    extends java.lang.Object
    implements java.io.Closeable
    Connects with MetadataStore and sets watch to listen changes for active broker list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.util.List<org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport> getAvailableBrokers()  
      void init()
      Initialize ZooKeeper session and creates broker cache list.
      • Methods inherited from class java.lang.Object

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

      • LOADBALANCE_BROKERS_ROOT

        public static final java.lang.String LOADBALANCE_BROKERS_ROOT
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetadataStoreCacheLoader

        public MetadataStoreCacheLoader​(PulsarResources pulsarResources,
                                        int operationTimeoutMs)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • init

        public void init()
                  throws java.lang.Exception
        Initialize ZooKeeper session and creates broker cache list.
        Throws:
        java.lang.Exception
      • getAvailableBrokers

        public java.util.List<org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport> getAvailableBrokers()
      • 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