|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.bookkeeper.client.LedgerHandle
public class LedgerHandle
Ledger handle on the client side. Contains ledger metadata used to access it. This api exposes the read and write to a ledger and also exposes a streaming api for the ledger.
| Nested Class Summary | |
|---|---|
static class |
LedgerHandle.QMode
|
| Method Summary | |
|---|---|
void |
addComplete(int rc,
LedgerHandle lh,
long entry,
Object ctx)
Implementation of callback interface for synchronous read method. |
long |
addEntry(byte[] data)
Add entry synchronously to an open ledger. |
void |
asyncAddEntry(byte[] data,
AsyncCallback.AddCallback cb,
Object ctx)
Add entry asynchronously to an open ledger. |
void |
asyncClose(AsyncCallback.CloseCallback cb,
Object ctx)
Asynchronous close |
void |
asyncReadEntries(long firstEntry,
long lastEntry,
AsyncCallback.ReadCallback cb,
Object ctx)
Read a sequence of entries asynchronously. |
void |
close()
Close ledger. |
long |
getId()
Returns the ledger identifier |
long |
getLast()
Returns the last entry identifier submitted |
int |
getThreshold()
|
void |
readComplete(int rc,
LedgerHandle lh,
LedgerSequence seq,
Object ctx)
Implementation of callback interface for synchronous read method. |
LedgerSequence |
readEntries(long firstEntry,
long lastEntry)
Read a sequence of entries synchronously. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int getThreshold()
public long getId()
public long getLast()
public void close()
throws KeeperException,
InterruptedException,
BKException
KeeperException
InterruptedException
BKException
public void asyncClose(AsyncCallback.CloseCallback cb,
Object ctx)
throws InterruptedException
cb - callback implementationctx - control object
InterruptedException
public void asyncReadEntries(long firstEntry,
long lastEntry,
AsyncCallback.ReadCallback cb,
Object ctx)
throws BKException,
InterruptedException
firstEntry - id of first entry of sequencelastEntry - id of last entry of sequencecb - object implementing read callback interfacectx - control object
BKException
InterruptedException
public LedgerSequence readEntries(long firstEntry,
long lastEntry)
throws InterruptedException,
BKException
firstEntry - id of first entry of sequencelastEntry - id of last entry of sequence
InterruptedException
BKException
public void asyncAddEntry(byte[] data,
AsyncCallback.AddCallback cb,
Object ctx)
throws InterruptedException,
BKException
data - array of bytes to be writtencb - object implementing callbackinterfacectx - some control object
InterruptedException
BKException
public long addEntry(byte[] data)
throws InterruptedException,
BKException
data - byte[]
InterruptedException
BKException
public void readComplete(int rc,
LedgerHandle lh,
LedgerSequence seq,
Object ctx)
readComplete in interface AsyncCallback.ReadCallbackrc - return codeleder - ledger identifierseq - sequence of entriesctx - control object
public void addComplete(int rc,
LedgerHandle lh,
long entry,
Object ctx)
addComplete in interface AsyncCallback.AddCallbackrc - return codeleder - ledger identifierentry - entry identifierctx - control object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||