Package org.apache.bookkeeper.bookie
Class LedgerDescriptor
java.lang.Object
org.apache.bookkeeper.bookie.LedgerDescriptor
- Direct Known Subclasses:
LedgerDescriptorImpl
Implements a ledger inside a bookie. In particular, it implements operations
to write entries to a ledger and read entries from a ledger.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract longaddEntry(io.netty.buffer.ByteBuf entry) (package private) abstract void(package private) abstract voidcheckAccess(byte[] masterKey) (package private) static LedgerDescriptorcreate(byte[] masterKey, long ledgerId, LedgerStorage ledgerStorage) (package private) static io.netty.buffer.ByteBufcreateLedgerFenceEntry(Long ledgerId) (package private) static LedgerDescriptorcreateReadOnly(long ledgerId, LedgerStorage ledgerStorage) (package private) abstract CompletableFuture<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.ByteBuf(package private) abstract long(package private) abstract long(package private) abstract 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 boolean(package private) abstract booleanwaitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)
-
Constructor Details
-
LedgerDescriptor
public LedgerDescriptor()
-
-
Method Details
-
create
static LedgerDescriptor create(byte[] masterKey, long ledgerId, LedgerStorage ledgerStorage) throws IOException - Throws:
IOException
-
createReadOnly
static LedgerDescriptor createReadOnly(long ledgerId, LedgerStorage ledgerStorage) throws IOException, Bookie.NoLedgerException - Throws:
IOExceptionBookie.NoLedgerException
-
createLedgerFenceEntry
-
checkAccess
- Throws:
BookieExceptionIOException
-
getLedgerId
abstract long getLedgerId() -
setFenced
- Throws:
IOException
-
isFenced
- Throws:
IOExceptionBookieException
-
fenceAndLogInJournal
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:
IOException
-
addEntry
- Throws:
IOExceptionBookieException
-
readEntry
- Throws:
IOExceptionBookieException
-
getLastAddConfirmed
- Throws:
IOExceptionBookieException
-
waitForLastAddConfirmedUpdate
abstract boolean waitForLastAddConfirmedUpdate(long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException - Throws:
IOException
-
cancelWaitForLastAddConfirmedUpdate
abstract void cancelWaitForLastAddConfirmedUpdate(Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException - Throws:
IOException
-
setExplicitLac
- Throws:
IOException
-
getExplicitLac
- Throws:
IOExceptionBookieException
-
getListOfEntriesOfLedger
- Throws:
IOException
-