Package org.apache.bookkeeper.verifier
Class BookkeeperVerifier.LedgerInfo
java.lang.Object
org.apache.bookkeeper.verifier.BookkeeperVerifier.LedgerInfo
- Enclosing class:
- BookkeeperVerifier
Contains the state required to reconstruct the contents of any entry in the ledger.
The seed value passed into the constructor fully determines the contents of the
ledger. Each EntryInfo has its own seed generated sequentially from a Random instance
seeded from the original seed. It then uses that seed to generate a secondary Random
instance for generating the bytes within the entry. See EntryIterator for details.
Random(seed)
|
E0 -> Random(E0) -> getBuffer()
|
E1 -> Random(E1) -> getBuffer()
|
E2 -> Random(E2) -> getBuffer()
|
E3 -> Random(E3) -> getBuffer()
|
E4 -> Random(E4) -> getBuffer()
|
...
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) BookkeeperVerifier.LedgerInfo.EntryIterator(package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcloseWrite(long entryID, Consumer<Integer> cb) (package private) void(package private) long(package private) BookkeeperVerifier.LedgerInfo.EntryIterator(package private) long(package private) ArrayList<BookkeeperVerifier.EntryInfo>getNextEntries(int num) (package private) voidincReads()booleanisClosed()(package private) voidThe idea here is that we may need to register an operation which needs to run whenever the final op completes on this Ledger (like deletion).(package private) voidVery similar to onLastOpComplete, but gets called on the final call to closeWrite.(package private) voidopenWrite(long entryID) void(package private) voidupdateLAC(long lac)
-
Field Details
-
writesInProgress
-
writesCompleted
-
readsInProgress
int readsInProgress -
onLastOp
-
onLastWrite
-
iter
-
-
Constructor Details
-
LedgerInfo
LedgerInfo(long ledgerID, long seed)
-
-
Method Details
-
getLastEntryIDCompleted
long getLastEntryIDCompleted() -
getConfirmedLAC
long getConfirmedLAC() -
getNextEntries
-
getIterator
BookkeeperVerifier.LedgerInfo.EntryIterator getIterator() -
openWrite
void openWrite(long entryID) -
incReads
void incReads() -
onLastOpComplete
The idea here is that we may need to register an operation which needs to run whenever the final op completes on this Ledger (like deletion). If there are none, newOnLastOp should be called synchronously with cb. Otherwise, cb should be called synchronously with cb and newOnLastOp should be called with the cb passed in with the decReads or closeWrite. In the deletion case, cb would be the callback for the error from the deletion operation (if it happens). The reason for all of this is that the delete case will need to chain an async call to delete into the async callback chain for whatever the last operation to complete on this Ledger. newOnLastOp would invoke that delete. The cb passed in allows it to pick up and continue the original chain.- Parameters:
cb- Callback to get result of newOnLastOp if called nownewOnLastOp- Callback to be invoked on the last decReads or closeWrite, should be passed the cb passed in with the final closeWrite or decReads
-
onLastWriteComplete
Very similar to onLastOpComplete, but gets called on the final call to closeWrite.- Parameters:
cb- Callback to get result of newOnLastWrite if called nownewOnLastWrite- Callback to be invoked on the last closeWrite, should be passed the cb passed in with the final closeWrite.
-
closeWrite
-
updateLAC
void updateLAC(long lac) -
decReads
-
isClosed
public boolean isClosed() -
setClosed
public void setClosed()
-