Package org.apache.bookkeeper.client
Class LedgerChecker
- java.lang.Object
-
- org.apache.bookkeeper.client.LedgerChecker
-
public class LedgerChecker extends java.lang.ObjectA 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLedgerChecker.InvalidFragmentException
-
Field Summary
Fields Modifier and Type Field Description BookieClientbookieClientBookieWatcherbookieWatcher(package private) java.util.concurrent.Semaphoresemaphore
-
Constructor Summary
Constructors Constructor Description LedgerChecker(BookKeeper bkc)LedgerChecker(BookKeeper bkc, int inFlightReadEntryNum)LedgerChecker(BookieClient client, BookieWatcher watcher)LedgerChecker(BookieClient client, BookieWatcher watcher, int inFlightReadEntryNum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquirePermit()Acquires a permit from permit manager, blocking until all are available.voidcheckLedger(LedgerHandle lh, BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb)Check that all the fragments in the passed in ledger, and report those which are missing.voidcheckLedger(LedgerHandle lh, BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb, long percentageOfLedgerFragmentToBeVerified)voidreleasePermit()Release a given permit.
-
-
-
Field Detail
-
bookieClient
public final BookieClient bookieClient
-
bookieWatcher
public final BookieWatcher bookieWatcher
-
semaphore
final java.util.concurrent.Semaphore semaphore
-
-
Constructor Detail
-
LedgerChecker
public LedgerChecker(BookKeeper bkc)
-
LedgerChecker
public LedgerChecker(BookieClient client, BookieWatcher watcher)
-
LedgerChecker
public LedgerChecker(BookKeeper bkc, int inFlightReadEntryNum)
-
LedgerChecker
public LedgerChecker(BookieClient client, BookieWatcher watcher, int inFlightReadEntryNum)
-
-
Method Detail
-
acquirePermit
public void acquirePermit() throws java.lang.InterruptedExceptionAcquires 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, 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, BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb, long percentageOfLedgerFragmentToBeVerified)
-
-