Package org.apache.bookkeeper.bookie
Interface Bookie
-
- All Known Implementing Classes:
BookieImpl,ReadOnlyBookie
public interface BookieInterface for the bookie.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classBookie.NoEntryExceptionException is thrown when no such an entry is found in this bookie.static classBookie.NoLedgerExceptionException is thrown when no such a ledger is found in this bookie.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddEntry(io.netty.buffer.ByteBuf entry, boolean ackBeforeSync, BookkeeperInternalCallbacks.WriteCallback cb, java.lang.Object ctx, byte[] masterKey)voidcancelWaitForLastAddConfirmedUpdate(long ledgerId, Watcher<LastAddConfirmedUpdateNotification> watcher)java.util.concurrent.CompletableFuture<java.lang.Boolean>fenceLedger(long ledgerId, byte[] masterKey)Fences a ledger.voidforceLedger(long ledgerId, BookkeeperInternalCallbacks.WriteCallback cb, java.lang.Object ctx)intgetExitCode()io.netty.buffer.ByteBufgetExplicitLac(long ledgerId)LedgerStoragegetLedgerStorage()java.util.PrimitiveIterator.OfLonggetListOfEntriesOfLedger(long ledgerId)StateManagergetStateManager()longgetTotalDiskSpace()longgetTotalFreeSpace()booleanisAvailableForHighPriorityWrites()booleanisReadOnly()booleanisRunning()voidjoin()io.netty.buffer.ByteBufreadEntry(long ledgerId, long entryId)longreadLastAddConfirmed(long ledgerId)voidrecoveryAddEntry(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback cb, java.lang.Object ctx, byte[] masterKey)voidsetExplicitLac(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback writeCallback, java.lang.Object ctx, byte[] masterKey)intshutdown()voidstart()booleanwaitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher)
-
-
-
Method Detail
-
start
void start()
-
join
void join() throws java.lang.InterruptedException
- Throws:
java.lang.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, java.lang.Object ctx, byte[] masterKey) throws java.io.IOException, BookieException, java.lang.InterruptedException- Throws:
java.io.IOExceptionBookieExceptionjava.lang.InterruptedException
-
recoveryAddEntry
void recoveryAddEntry(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback cb, java.lang.Object ctx, byte[] masterKey) throws java.io.IOException, BookieException, java.lang.InterruptedException- Throws:
java.io.IOExceptionBookieExceptionjava.lang.InterruptedException
-
forceLedger
void forceLedger(long ledgerId, BookkeeperInternalCallbacks.WriteCallback cb, java.lang.Object ctx)
-
setExplicitLac
void setExplicitLac(io.netty.buffer.ByteBuf entry, BookkeeperInternalCallbacks.WriteCallback writeCallback, java.lang.Object ctx, byte[] masterKey) throws java.io.IOException, java.lang.InterruptedException, BookieException- Throws:
java.io.IOExceptionjava.lang.InterruptedExceptionBookieException
-
getExplicitLac
io.netty.buffer.ByteBuf getExplicitLac(long ledgerId) throws java.io.IOException, Bookie.NoLedgerException, BookieException- Throws:
java.io.IOExceptionBookie.NoLedgerExceptionBookieException
-
getTotalDiskSpace
long getTotalDiskSpace() throws java.io.IOException- Throws:
java.io.IOException
-
getTotalFreeSpace
long getTotalFreeSpace() throws java.io.IOException- Throws:
java.io.IOException
-
readEntry
io.netty.buffer.ByteBuf readEntry(long ledgerId, long entryId) throws java.io.IOException, Bookie.NoLedgerException, BookieException- Throws:
java.io.IOExceptionBookie.NoLedgerExceptionBookieException
-
readLastAddConfirmed
long readLastAddConfirmed(long ledgerId) throws java.io.IOException, BookieException- Throws:
java.io.IOExceptionBookieException
-
getListOfEntriesOfLedger
java.util.PrimitiveIterator.OfLong getListOfEntriesOfLedger(long ledgerId) throws java.io.IOException, Bookie.NoLedgerException- Throws:
java.io.IOExceptionBookie.NoLedgerException
-
fenceLedger
java.util.concurrent.CompletableFuture<java.lang.Boolean> fenceLedger(long ledgerId, byte[] masterKey) throws java.io.IOException, BookieExceptionFences 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:
java.io.IOExceptionBookieException
-
waitForLastAddConfirmedUpdate
boolean waitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException- Throws:
java.io.IOException
-
cancelWaitForLastAddConfirmedUpdate
void cancelWaitForLastAddConfirmedUpdate(long ledgerId, Watcher<LastAddConfirmedUpdateNotification> watcher) throws java.io.IOException- Throws:
java.io.IOException
-
getStateManager
StateManager getStateManager()
-
getLedgerStorage
LedgerStorage getLedgerStorage()
-
-