Package org.apache.bookkeeper.meta
Class AbstractHierarchicalLedgerManager
java.lang.Object
org.apache.bookkeeper.meta.AbstractZkLedgerManager
org.apache.bookkeeper.meta.AbstractHierarchicalLedgerManager
- All Implemented Interfaces:
Closeable,AutoCloseable,LedgerManager,org.apache.zookeeper.Watcher
- Direct Known Subclasses:
HierarchicalLedgerManager,LegacyHierarchicalLedgerManager,LongHierarchicalLedgerManager
An abstract class for managing hierarchical ledgers.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.bookkeeper.meta.AbstractZkLedgerManager
AbstractZkLedgerManager.CancelWatchLedgerMetadataTask, AbstractZkLedgerManager.ReadLedgerMetadataTaskNested classes/interfaces inherited from interface org.apache.bookkeeper.meta.LedgerManager
LedgerManager.LedgerRange, LedgerManager.LedgerRangeIteratorNested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event, org.apache.zookeeper.Watcher.WatcherType -
Field Summary
Fields inherited from class org.apache.bookkeeper.meta.AbstractZkLedgerManager
conf, ledgerRootPath, listeners, scheduler, zk, ZK_CONNECT_BACKOFF_MS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHierarchicalLedgerManager(AbstractConfiguration conf, org.apache.zookeeper.ZooKeeper zk) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) voidasyncProcessLevelNodes(String path, BookkeeperInternalCallbacks.Processor<String> processor, org.apache.zookeeper.AsyncCallback.VoidCallback finalCb, Object context, int successRc, int failureRc) Process hash nodes in a given path.(package private) longgetLedgerId(String... levelNodes) protected NavigableSet<Long>ledgerListToSet(List<String> ledgerNodes, String path) Get all ledger ids in the given zk path.Methods inherited from class org.apache.bookkeeper.meta.AbstractZkLedgerManager
asyncProcessLedgersInSingleNode, close, createLedgerMetadata, getLedgerId, getLedgerParentNodeRegex, getLedgerPath, isLeadgerIdGeneratorZnode, isLedgerParentNode, isSpecialZnode, process, readLedgerMetadata, readLedgerMetadata, registerLedgerMetadataListener, removeLedgerMetadata, unregisterLedgerMetadataListener, writeLedgerMetadataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.meta.LedgerManager
asyncProcessLedgers, getLedgerRanges
-
Constructor Details
-
AbstractHierarchicalLedgerManager
public AbstractHierarchicalLedgerManager(AbstractConfiguration conf, org.apache.zookeeper.ZooKeeper zk) Constructor.- Parameters:
conf- Configuration objectzk- ZooKeeper Client Handle
-
-
Method Details
-
asyncProcessLevelNodes
void asyncProcessLevelNodes(String path, BookkeeperInternalCallbacks.Processor<String> processor, org.apache.zookeeper.AsyncCallback.VoidCallback finalCb, Object context, int successRc, int failureRc) Process hash nodes in a given path. -
getLedgerId
- Throws:
IOException
-
ledgerListToSet
Get all ledger ids in the given zk path.- Overrides:
ledgerListToSetin classAbstractZkLedgerManager- Parameters:
ledgerNodes- List of ledgers in the given path example:- {L1652, L1653, L1650}path- The zookeeper path of the ledger ids. The path should start with example (with ledgerRootPath = /ledgers):- /ledgers/00/0053- Returns:
- ledger id hash set
-