Package org.apache.bookkeeper.bookie
Class LedgerDescriptor
- java.lang.Object
- 
- org.apache.bookkeeper.bookie.LedgerDescriptor
 
- 
- Direct Known Subclasses:
- LedgerDescriptorImpl
 
 public abstract class LedgerDescriptor extends java.lang.ObjectImplements a ledger inside a bookie. In particular, it implements operations to write entries to a ledger and read entries from a ledger.
- 
- 
Constructor SummaryConstructors Constructor Description LedgerDescriptor()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract longaddEntry(io.netty.buffer.ByteBuf entry)(package private) abstract voidcancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher)(package private) abstract voidcheckAccess(byte[] masterKey)(package private) static LedgerDescriptorcreate(byte[] masterKey, long ledgerId, LedgerStorage ledgerStorage)(package private) static io.netty.buffer.ByteBufcreateLedgerFenceEntry(java.lang.Long ledgerId)(package private) static LedgerDescriptorcreateReadOnly(long ledgerId, LedgerStorage ledgerStorage)(package private) abstract java.util.concurrent.CompletableFuture<java.lang.Boolean>fenceAndLogInJournal(Journal journal)When we fence a ledger, we need to first set ledger to fenced state in memory and then log the fence entry in Journal so that we can rebuild the state.(package private) abstract io.netty.buffer.ByteBufgetExplicitLac()(package private) abstract longgetLastAddConfirmed()(package private) abstract longgetLedgerId()(package private) abstract java.util.PrimitiveIterator.OfLonggetListOfEntriesOfLedger(long ledgerId)(package private) abstract booleanisFenced()(package private) abstract io.netty.buffer.ByteBufreadEntry(long entryId)(package private) abstract voidsetExplicitLac(io.netty.buffer.ByteBuf entry)(package private) abstract booleansetFenced()(package private) abstract booleanwaitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)
 
- 
- 
- 
Method Detail- 
createstatic LedgerDescriptor create(byte[] masterKey, long ledgerId, LedgerStorage ledgerStorage) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
createReadOnlystatic LedgerDescriptor createReadOnly(long ledgerId, LedgerStorage ledgerStorage) throws java.io.IOException, Bookie.NoLedgerException - Throws:
- java.io.IOException
- Bookie.NoLedgerException
 
 - 
createLedgerFenceEntrystatic io.netty.buffer.ByteBuf createLedgerFenceEntry(java.lang.Long ledgerId) 
 - 
checkAccessabstract void checkAccess(byte[] masterKey) throws BookieException, java.io.IOException- Throws:
- BookieException
- java.io.IOException
 
 - 
getLedgerIdabstract long getLedgerId() 
 - 
setFencedabstract boolean setFenced() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
isFencedabstract boolean isFenced() throws java.io.IOException, BookieException- Throws:
- java.io.IOException
- BookieException
 
 - 
fenceAndLogInJournalabstract java.util.concurrent.CompletableFuture<java.lang.Boolean> fenceAndLogInJournal(Journal journal) throws java.io.IOException When we fence a ledger, we need to first set ledger to fenced state in memory and then log the fence entry in Journal so that we can rebuild the state.We should satisfy the future only after we complete logging fence entry in Journal - Returns:
- Throws:
- java.io.IOException
 
 - 
addEntryabstract long addEntry(io.netty.buffer.ByteBuf entry) throws java.io.IOException, BookieException- Throws:
- java.io.IOException
- BookieException
 
 - 
readEntryabstract io.netty.buffer.ByteBuf readEntry(long entryId) throws java.io.IOException, BookieException- Throws:
- java.io.IOException
- BookieException
 
 - 
getLastAddConfirmedabstract long getLastAddConfirmed() throws java.io.IOException, BookieException- Throws:
- java.io.IOException
- BookieException
 
 - 
waitForLastAddConfirmedUpdateabstract boolean waitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
cancelWaitForLastAddConfirmedUpdateabstract void cancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
setExplicitLacabstract void setExplicitLac(io.netty.buffer.ByteBuf entry) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getExplicitLacabstract io.netty.buffer.ByteBuf getExplicitLac() throws java.io.IOException, BookieException- Throws:
- java.io.IOException
- BookieException
 
 - 
getListOfEntriesOfLedgerabstract java.util.PrimitiveIterator.OfLong getListOfEntriesOfLedger(long ledgerId) throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-