public class LedgerHandleAdv extends LedgerHandle implements WriteAdvHandle
LedgerHandle to provide API to add entries with
user supplied entryIds. Through this interface Ledger Length may not be accurate while the
ledger being written.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
LedgerHandleAdv.PendingOpsComparator |
LedgerHandle.LastConfirmedCtx, LedgerHandle.NoopCloseCallback| Modifier and Type | Field and Description |
|---|---|
(package private) static org.slf4j.Logger |
LOG |
bookieFailureHistory, bookiesHealthInfo, changingEnsemble, clientCtx, delayedWriteFailedBookies, distributionSchedule, ensembleChangeCounter, explicitLacFlushPolicy, INVALID_ENTRY_ID, INVALID_LEDGER_ID, lacUpdateHitsCounter, lacUpdateMissesCounter, lastAddConfirmed, lastAddPushed, ledgerId, ledgerKey, length, macManager, metadataLock, numEnsembleChanges, pendingAddOps, pendingAddsSequenceHead, throttler, timeoutFuture, writeFlags| Constructor and Description |
|---|
LedgerHandleAdv(ClientContext clientCtx,
long ledgerId,
org.apache.bookkeeper.versioning.Versioned<LedgerMetadata> metadata,
BookKeeper.DigestType digestType,
byte[] password,
java.util.EnumSet<WriteFlag> writeFlags) |
| Modifier and Type | Method and Description |
|---|---|
long |
addEntry(long entryId,
byte[] data)
Add entry synchronously to an open ledger.
|
long |
addEntry(long entryId,
byte[] data,
int offset,
int length)
Add entry synchronously to an open ledger.
|
void |
asyncAddEntry(byte[] data,
int offset,
int length,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
LedgerHandleAdv will not allow addEntry without providing an entryId.
|
void |
asyncAddEntry(io.netty.buffer.ByteBuf data,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
LedgerHandleAdv will not allow addEntry without providing an entryId.
|
void |
asyncAddEntry(long entryId,
byte[] data,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
Add entry asynchronously to an open ledger.
|
void |
asyncAddEntry(long entryId,
byte[] data,
int offset,
int length,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
Add entry asynchronously to an open ledger, using an offset and range.
|
void |
asyncAddEntry(long entryId,
byte[] data,
int offset,
int length,
AsyncCallback.AddCallbackWithLatency cb,
java.lang.Object ctx)
Add entry asynchronously to an open ledger, using an offset and range.
|
void |
asyncAddEntry(long entryId,
io.netty.buffer.ByteBuf data,
AsyncCallback.AddCallbackWithLatency cb,
java.lang.Object ctx)
Add entry asynchronously to an open ledger, using an offset and range.
|
protected void |
doAsyncAddEntry(PendingAddOp op)
Overriding part is mostly around setting entryId.
|
java.util.concurrent.CompletableFuture<java.lang.Long> |
writeAsync(long entryId,
io.netty.buffer.ByteBuf data)
Add entry asynchronously to an open ledger.
|
addEntry, addEntry, addToLength, appendAsync, asyncAddEntry, asyncClose, asyncCloseInternal, asyncReadEntries, asyncReadEntriesInternal, asyncReadExplicitLastConfirmed, asyncReadLastConfirmed, asyncReadLastConfirmedAndEntry, asyncReadLastEntry, asyncReadUnconfirmedEntries, asyncRecoveryAddEntry, asyncTryReadLastConfirmed, close, closeAsync, doAsyncCloseInternal, drainPendingAddsAndAdjustLength, ensembleChangeLoop, errorOutPendingAdds, errorOutPendingAdds, force, getBookiesHealthInfo, getCtime, getCurrentEnsemble, getCustomMetadata, getDigestManager, getDistributionSchedule, getId, getLastAddConfirmed, getLastAddPushed, getLedgerKey, getLedgerMetadata, getLength, getNumBookies, getNumFragments, getVersionedLedgerMetadata, getWriteFlags, getWriteSetForReadOperation, handleBookieFailure, handleUnrecoverableErrorDuringAdd, hasDelayedWriteFailedBookies, initializeWriteHandleState, isClosed, isHandleWritable, maybeHandleDelayedWriteBookieFailure, notifyWriteFailed, readAsync, readEntries, readEntriesInternalAsync, readExplicitLastConfirmed, readLastAddConfirmedAndEntryAsync, readLastAddConfirmedAsync, readLastConfirmed, readLastEntry, readUnconfirmedAsync, readUnconfirmedEntries, recordReadErrorOnBookie, registerOperationFailureOnBookie, sendAddSuccessCallbacks, setLastAddConfirmed, setLedgerMetadata, tryReadLastAddConfirmedAsync, tryReadLastConfirmed, unsetSuccessAndSendWriteRequest, updateLastConfirmed, waitForWritableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, write, write, writeAsync, writeAsync, writeAsyncgetLastAddConfirmed, getLength, isClosed, read, readAsync, readLastAddConfirmed, readLastAddConfirmedAndEntry, readLastAddConfirmedAndEntryAsync, readLastAddConfirmedAsync, readUnconfirmed, readUnconfirmedAsync, tryReadLastAddConfirmed, tryReadLastAddConfirmedAsyncclose, closeAsync, getId, getLedgerMetadataforceappend, append, append, append, appendAsync, appendAsync, appendAsyncLedgerHandleAdv(ClientContext clientCtx, long ledgerId, org.apache.bookkeeper.versioning.Versioned<LedgerMetadata> metadata, BookKeeper.DigestType digestType, byte[] password, java.util.EnumSet<WriteFlag> writeFlags) throws java.security.GeneralSecurityException, java.lang.NumberFormatException
java.security.GeneralSecurityExceptionjava.lang.NumberFormatExceptionpublic long addEntry(long entryId,
byte[] data)
throws java.lang.InterruptedException,
BKException
addEntry in class LedgerHandleentryId - entryId of the entry to adddata - array of bytes to be written to the ledger
do not reuse the buffer, bk-client will release it appropriatelyjava.lang.InterruptedExceptionBKExceptionpublic long addEntry(long entryId,
byte[] data,
int offset,
int length)
throws java.lang.InterruptedException,
BKException
addEntry in class LedgerHandleentryId - entryId of the entry to adddata - array of bytes to be written to the ledger
do not reuse the buffer, bk-client will release it appropriatelyoffset - offset from which to take bytes from datalength - number of bytes to take from datajava.lang.InterruptedExceptionBKExceptionpublic void asyncAddEntry(long entryId,
byte[] data,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
asyncAddEntry in class LedgerHandleentryId - entryId of the entry to adddata - array of bytes to be written
do not reuse the buffer, bk-client will release it appropriatelycb - object implementing callbackinterfacectx - some control objectpublic void asyncAddEntry(long entryId,
byte[] data,
int offset,
int length,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
asyncAddEntry in class LedgerHandleentryId - entryId of the entry to adddata - array of bytes to be written
do not reuse the buffer, bk-client will release it appropriatelyoffset - offset from which to take bytes from datalength - number of bytes to take from datacb - object implementing callbackinterfacectx - some control objectjava.lang.ArrayIndexOutOfBoundsException - if offset or length is negative or offset and length sum to a
value higher than the length of data.public void asyncAddEntry(long entryId,
byte[] data,
int offset,
int length,
AsyncCallback.AddCallbackWithLatency cb,
java.lang.Object ctx)
asyncAddEntry in class LedgerHandleentryId - entryId of the entry to adddata - array of bytes to be written
do not reuse the buffer, bk-client will release it appropriatelyoffset - offset from which to take bytes from datalength - number of bytes to take from datacb - object implementing callbackinterfacectx - some control objectjava.lang.ArrayIndexOutOfBoundsException - if offset or length is negative or offset and length sum to a
value higher than the length of data.public void asyncAddEntry(long entryId,
io.netty.buffer.ByteBuf data,
AsyncCallback.AddCallbackWithLatency cb,
java.lang.Object ctx)
LedgerHandleAdv returned through
ledgers created with createLedgerAdv(int, int, int, DigestType, byte[]).asyncAddEntry in class LedgerHandleentryId - entryId of the entry to add.data - io.netty.buffer.ByteBuf of bytes to be written
do not reuse the buffer, bk-client will release it appropriatelycb - object implementing callbackinterfacectx - some control objectprotected void doAsyncAddEntry(PendingAddOp op)
doAsyncAddEntry in class LedgerHandlepublic java.util.concurrent.CompletableFuture<java.lang.Long> writeAsync(long entryId,
io.netty.buffer.ByteBuf data)
WriteAdvHandlewriteAsync in interface WriteAdvHandleentryId - entryId to be addeddata - array of bytes to be written
do not reuse the buffer, bk-client will release it appropriately.public void asyncAddEntry(io.netty.buffer.ByteBuf data,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
asyncAddEntry in class LedgerHandlepublic void asyncAddEntry(byte[] data,
int offset,
int length,
AsyncCallback.AddCallback cb,
java.lang.Object ctx)
asyncAddEntry in class LedgerHandledata - array of bytes to be written
do not reuse the buffer, bk-client will release it appropriatelyoffset - offset from which to take bytes from datalength - number of bytes to take from datacb - object implementing callbackinterfacectx - some control objectCopyright © 2011–2024 The Apache Software Foundation. All rights reserved.