Package org.apache.bookkeeper.client
Class LedgerChecker
- java.lang.Object
-
- org.apache.bookkeeper.client.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LedgerChecker.InvalidFragmentException
-
Field Summary
Fields Modifier and Type Field Description BookieClient
bookieClient
BookieWatcher
bookieWatcher
(package private) java.util.concurrent.Semaphore
semaphore
-
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 void
acquirePermit()
Acquires a permit from permit manager, blocking until all are available.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.void
checkLedger(LedgerHandle lh, BookkeeperInternalCallbacks.GenericCallback<java.util.Set<LedgerFragment>> cb, long percentageOfLedgerFragmentToBeVerified)
void
releasePermit()
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.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, 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)
-
-