Package org.apache.bookkeeper.bookie
Interface LedgerCache
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
InterleavedStorageRegenerateIndexOp.DryRunLedgerCache,LedgerCacheImpl
This class maps a ledger entry number into a location (entrylogid, offset) in
an entry log file. It does user level caching to more efficiently manage disk
head scheduling.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classRepresents summary of ledger metadata.static classSpecific exception to encode the case where the index is not present.static interfaceRepresents a page of the index.static interfaceIterable over index pages -- returns PageEntries rather than individual entries because getEntries() above needs to be able to throw an IOException. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelWaitForLastAddConfirmedUpdate(long ledgerId, Watcher<LastAddConfirmedUpdateNotification> watcher) voiddeleteLedger(long ledgerId) voidflushLedger(boolean doAll) getEntriesIterator(long ledgerId) longgetEntryOffset(long ledger, long entry) io.netty.buffer.ByteBufgetExplicitLac(long ledgerId) getLastAddConfirmed(long ledgerId) longgetLastEntry(long ledgerId) booleanisFenced(long ledgerId) booleanledgerExists(long ledgerId) listEntries(long ledgerId) voidputEntryOffset(long ledger, long entry, long offset) readLedgerIndexMetadata(long ledgerId) byte[]readMasterKey(long ledgerId) voidsetExplicitLac(long ledgerId, io.netty.buffer.ByteBuf lac) booleansetFenced(long ledgerId) voidsetMasterKey(long ledgerId, byte[] masterKey) longupdateLastAddConfirmed(long ledgerId, long lac) booleanwaitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)
-
Method Details
-
setFenced
- Throws:
IOException
-
isFenced
- Throws:
IOException
-
setMasterKey
- Throws:
IOException
-
readMasterKey
- Throws:
IOExceptionBookieException
-
ledgerExists
- Throws:
IOException
-
putEntryOffset
- Throws:
IOException
-
getEntryOffset
- Throws:
IOException
-
flushLedger
- Throws:
IOException
-
getLastEntry
- Throws:
IOException
-
getLastAddConfirmed
- Throws:
IOException
-
updateLastAddConfirmed
- Throws:
IOException
-
waitForLastAddConfirmedUpdate
boolean waitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException - Throws:
IOException
-
cancelWaitForLastAddConfirmedUpdate
void cancelWaitForLastAddConfirmedUpdate(long ledgerId, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException - Throws:
IOException
-
deleteLedger
- Throws:
IOException
-
setExplicitLac
- Throws:
IOException
-
getExplicitLac
io.netty.buffer.ByteBuf getExplicitLac(long ledgerId) -
listEntries
- Throws:
IOException
-
getEntriesIterator
- Throws:
IOException
-
readLedgerIndexMetadata
- Throws:
IOException
-