Class LegacyHierarchicalLedgerRangeIterator
- java.lang.Object
-
- org.apache.pulsar.metadata.bookkeeper.LegacyHierarchicalLedgerRangeIterator
-
- All Implemented Interfaces:
org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator
public class LegacyHierarchicalLedgerRangeIterator extends java.lang.Object implements org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIteratorHierarchical Ledger Manager which manages ledger meta in zookeeper using 2-level hierarchical znodes.LegacyHierarchicalLedgerManager splits the generated id into 3 parts (2-4-4):
<level1 (2 digits)><level2 (4 digits)><level3 (4 digits)>
These 3 parts are used to form the actual ledger node path used to store ledger metadata:(ledgersRootPath)/level1/level2/L(level3)
E.g Ledger 0000000001 is split into 3 parts 00, 0000, 0001, which is stored in (ledgersRootPath)/00/0000/L0001. So each znode could have at most 10000 ledgers, which avoids errors during garbage collection due to lists of children that are too long.
-
-
Constructor Summary
Constructors Constructor Description LegacyHierarchicalLedgerRangeIterator(MetadataStore store, java.lang.String ledgersRoot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()org.apache.bookkeeper.meta.LedgerManager.LedgerRangenext()
-
-
-
Constructor Detail
-
LegacyHierarchicalLedgerRangeIterator
public LegacyHierarchicalLedgerRangeIterator(MetadataStore store, java.lang.String ledgersRoot)
-
-
Method Detail
-
hasNext
public boolean hasNext() throws java.io.IOException- Specified by:
hasNextin interfaceorg.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator- Throws:
java.io.IOException
-
next
public org.apache.bookkeeper.meta.LedgerManager.LedgerRange next() throws java.io.IOException- Specified by:
nextin interfaceorg.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator- Throws:
java.io.IOException
-
-