Class LegacyHierarchicalLedgerRangeIterator

  • All Implemented Interfaces:
    org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator

    public class LegacyHierarchicalLedgerRangeIterator
    extends java.lang.Object
    implements org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator
    Hierarchical 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      org.apache.bookkeeper.meta.LedgerManager.LedgerRange next()  
      • Methods inherited from class java.lang.Object

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

      • LegacyHierarchicalLedgerRangeIterator

        public LegacyHierarchicalLedgerRangeIterator​(MetadataStore store,
                                                     java.lang.String ledgersRoot)
    • Method Detail

      • hasNext

        public boolean hasNext()
                        throws java.io.IOException
        Specified by:
        hasNext in interface org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator
        Throws:
        java.io.IOException
      • next

        public org.apache.bookkeeper.meta.LedgerManager.LedgerRange next()
                                                                  throws java.io.IOException
        Specified by:
        next in interface org.apache.bookkeeper.meta.LedgerManager.LedgerRangeIterator
        Throws:
        java.io.IOException