Package org.apache.bookkeeper.meta
Class AbstractHierarchicalLedgerManager
- java.lang.Object
-
- org.apache.bookkeeper.meta.AbstractZkLedgerManager
-
- org.apache.bookkeeper.meta.AbstractHierarchicalLedgerManager
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LedgerManager
,org.apache.zookeeper.Watcher
- Direct Known Subclasses:
HierarchicalLedgerManager
,LegacyHierarchicalLedgerManager
,LongHierarchicalLedgerManager
public abstract class AbstractHierarchicalLedgerManager extends AbstractZkLedgerManager
An abstract class for managing hierarchical ledgers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.bookkeeper.meta.AbstractZkLedgerManager
AbstractZkLedgerManager.CancelWatchLedgerMetadataTask, AbstractZkLedgerManager.ReadLedgerMetadataTask
-
Nested classes/interfaces inherited from interface org.apache.bookkeeper.meta.LedgerManager
LedgerManager.LedgerRange, LedgerManager.LedgerRangeIterator
-
-
Field Summary
-
Fields inherited from class org.apache.bookkeeper.meta.AbstractZkLedgerManager
conf, ledgerRootPath, listeners, scheduler, zk, ZK_CONNECT_BACKOFF_MS
-
-
Constructor Summary
Constructors Constructor Description AbstractHierarchicalLedgerManager(AbstractConfiguration conf, org.apache.zookeeper.ZooKeeper zk)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
asyncProcessLevelNodes(java.lang.String path, BookkeeperInternalCallbacks.Processor<java.lang.String> processor, org.apache.zookeeper.AsyncCallback.VoidCallback finalCb, java.lang.Object context, int successRc, int failureRc)
Process hash nodes in a given path.(package private) long
getLedgerId(java.lang.String... levelNodes)
protected java.util.NavigableSet<java.lang.Long>
ledgerListToSet(java.util.List<java.lang.String> ledgerNodes, java.lang.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, writeLedgerMetadata
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.bookkeeper.meta.LedgerManager
asyncProcessLedgers, getLedgerRanges
-
-
-
-
Constructor Detail
-
AbstractHierarchicalLedgerManager
public AbstractHierarchicalLedgerManager(AbstractConfiguration conf, org.apache.zookeeper.ZooKeeper zk)
Constructor.- Parameters:
conf
- Configuration objectzk
- ZooKeeper Client Handle
-
-
Method Detail
-
asyncProcessLevelNodes
void asyncProcessLevelNodes(java.lang.String path, BookkeeperInternalCallbacks.Processor<java.lang.String> processor, org.apache.zookeeper.AsyncCallback.VoidCallback finalCb, java.lang.Object context, int successRc, int failureRc)
Process hash nodes in a given path.
-
getLedgerId
long getLedgerId(java.lang.String... levelNodes) throws java.io.IOException
- Throws:
java.io.IOException
-
ledgerListToSet
protected java.util.NavigableSet<java.lang.Long> ledgerListToSet(java.util.List<java.lang.String> ledgerNodes, java.lang.String path)
Get all ledger ids in the given zk path.- Overrides:
ledgerListToSet
in 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
-
-