public class LedgerHandleAdv extends LedgerHandle
LedgerHandle
to provide API to add entries with
user supplied entryIds. Through this interface Ledger Length may not be accurate wile the
ledger being written.INVALID_ENTRY_ID
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(long entryId,
byte[] data,
AsyncCallback.AddCallback cb,
Object ctx)
Add entry asynchronously to an open ledger.
|
void |
asyncAddEntry(long entryId,
byte[] data,
int offset,
int length,
AsyncCallback.AddCallback cb,
Object ctx)
Add entry asynchronously to an open ledger, using an offset and range.
|
addEntry, addEntry, asyncAddEntry, asyncAddEntry, asyncClose, asyncReadEntries, asyncReadLastConfirmed, asyncTryReadLastConfirmed, close, getId, getLastAddConfirmed, getLastAddPushed, getLedgerKey, getLength, isClosed, readEntries, readLastConfirmed, tryReadLastConfirmed
public long addEntry(long entryId, byte[] data) throws InterruptedException, BKException
addEntry
in class LedgerHandle
entryId
- entryId of the entry to adddata
- array of bytes to be written to the ledgerInterruptedException
BKException
public long addEntry(long entryId, byte[] data, int offset, int length) throws InterruptedException, BKException
addEntry
in class LedgerHandle
entryId
- entryId of the entry to adddata
- array of bytes to be written to the ledgeroffset
- offset from which to take bytes from datalength
- number of bytes to take from dataInterruptedException
BKException
public void asyncAddEntry(long entryId, byte[] data, AsyncCallback.AddCallback cb, Object ctx) throws BKException
asyncAddEntry
in class LedgerHandle
entryId
- entryId of the entry to adddata
- array of bytes to be writtencb
- object implementing callbackinterfacectx
- some control objectBKException
public void asyncAddEntry(long entryId, byte[] data, int offset, int length, AsyncCallback.AddCallback cb, Object ctx)
asyncAddEntry
in class LedgerHandle
entryId
- entryId of the entry to adddata
- array of bytes to be writtenoffset
- offset from which to take bytes from datalength
- number of bytes to take from datacb
- object implementing callbackinterfacectx
- some control objectArrayIndexOutOfBoundsException
- if offset or length is negative or offset and length sum to a
value higher than the length of data.Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.