Package org.apache.bookkeeper.bookie
Interface Bookie
- All Known Implementing Classes:
BookieImpl,ReadOnlyBookie
public interface Bookie
Interface for the bookie.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classException is thrown when no such an entry is found in this bookie.static classException is thrown when no such a ledger is found in this bookie. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(io.netty.buffer.ByteBuf entry, boolean ackBeforeSync, BookkeeperInternalCallbacks.WriteCallback cb, Object ctx, byte[] masterKey) voidcancelWaitForLastAddConfirmedUpdate(long ledgerId, Watcher<LastAddConfirmedUpdateNotification> watcher) fenceLedger(long ledgerId, byte[] masterKey) Fences a ledger.voidforceLedger(long ledgerId, BookkeeperInternalCallbacks.WriteCallback cb, Object ctx) intio.netty.buffer.ByteBufgetExplicitLac(long ledgerId) getListOfEntriesOfLedger(long ledgerId) longlongbooleanbooleanbooleanvoidjoin()io.netty.buffer.ByteBufreadEntry(long ledgerId, long entryId) longreadLastAddConfirmed(long ledgerId) voidrecoveryAddEntry(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback cb, Object ctx, byte[] masterKey) voidsetExplicitLac(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback writeCallback, Object ctx, byte[] masterKey) intshutdown()voidstart()booleanwaitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)
-
Method Details
-
start
void start() -
join
- Throws:
InterruptedException
-
isRunning
boolean isRunning() -
getExitCode
int getExitCode() -
shutdown
int shutdown() -
isAvailableForHighPriorityWrites
boolean isAvailableForHighPriorityWrites() -
isReadOnly
boolean isReadOnly() -
addEntry
void addEntry(io.netty.buffer.ByteBuf entry, boolean ackBeforeSync, BookkeeperInternalCallbacks.WriteCallback cb, Object ctx, byte[] masterKey) throws IOException, BookieException, InterruptedException -
recoveryAddEntry
void recoveryAddEntry(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback cb, Object ctx, byte[] masterKey) throws IOException, BookieException, InterruptedException -
forceLedger
-
setExplicitLac
void setExplicitLac(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback writeCallback, Object ctx, byte[] masterKey) throws IOException, InterruptedException, BookieException -
getExplicitLac
io.netty.buffer.ByteBuf getExplicitLac(long ledgerId) throws IOException, Bookie.NoLedgerException, BookieException -
getTotalDiskSpace
- Throws:
IOException
-
getTotalFreeSpace
- Throws:
IOException
-
readEntry
io.netty.buffer.ByteBuf readEntry(long ledgerId, long entryId) throws IOException, Bookie.NoLedgerException, BookieException -
readLastAddConfirmed
- Throws:
IOExceptionBookieException
-
getListOfEntriesOfLedger
PrimitiveIterator.OfLong getListOfEntriesOfLedger(long ledgerId) throws IOException, Bookie.NoLedgerException - Throws:
IOExceptionBookie.NoLedgerException
-
fenceLedger
CompletableFuture<Boolean> fenceLedger(long ledgerId, byte[] masterKey) throws IOException, BookieException Fences a ledger. From this point on, clients will be unable to write to this ledger. Only recoveryAddEntry will be able to add entries to the ledger. This method is idempotent. Once a ledger is fenced, it can never be unfenced. Fencing a fenced ledger has no effect.- Returns:
- Throws:
IOExceptionBookieException
-
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
-
getStateManager
StateManager getStateManager() -
getLedgerStorage
LedgerStorage getLedgerStorage()
-