Class LedgerChecker


  • public class LedgerChecker
    extends java.lang.Object
    A utility class to check the complete ledger and finds the UnderReplicated fragments if any.

    NOTE: This class is tended to be used by this project only. External users should not rely on it directly.

    • Field Detail

      • bookieClient

        public final org.apache.bookkeeper.proto.BookieClient bookieClient
      • semaphore

        final java.util.concurrent.Semaphore semaphore
    • Constructor Detail

      • LedgerChecker

        public LedgerChecker​(BookKeeper bkc)
      • LedgerChecker

        public LedgerChecker​(org.apache.bookkeeper.proto.BookieClient client,
                             BookieWatcher watcher)
      • LedgerChecker

        public LedgerChecker​(BookKeeper bkc,
                             int inFlightReadEntryNum)
      • LedgerChecker

        public LedgerChecker​(org.apache.bookkeeper.proto.BookieClient client,
                             BookieWatcher watcher,
                             int inFlightReadEntryNum)
    • Method Detail

      • acquirePermit

        public void acquirePermit()
                           throws java.lang.InterruptedException
        Acquires a permit from permit manager, blocking until all are available.
        Throws:
        java.lang.InterruptedException
      • releasePermit

        public void releasePermit()
        Release a given permit.
      • checkLedger

        public void checkLedger​(LedgerHandle lh,
                                org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb)
        Check that all the fragments in the passed in ledger, and report those which are missing.
      • checkLedger

        public void checkLedger​(LedgerHandle lh,
                                org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb,
                                long percentageOfLedgerFragmentToBeVerified)