Class MetadataStoreCacheLoader
- java.lang.Object
-
- org.apache.pulsar.broker.resources.MetadataStoreCacheLoader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class MetadataStoreCacheLoader extends java.lang.Object implements java.io.CloseableConnects with MetadataStore and sets watch to listen changes for active broker list.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOADBALANCE_BROKERS_ROOT
-
Constructor Summary
Constructors Constructor Description MetadataStoreCacheLoader(PulsarResources pulsarResources, int operationTimeoutMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.util.List<org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport>getAvailableBrokers()voidinit()Initialize ZooKeeper session and creates broker cache list.
-
-
-
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.ExceptionInitialize 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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-