|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.apache.bookkeeper.proto.BookieClient
public class BookieClient
Implements the client-side part of the BookKeeper protocol.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
BookieClient(InetSocketAddress addr,
int recvTimeout)
|
|
BookieClient(String host,
int port,
int recvTimeout)
|
|
| Method Summary | |
|---|---|
void |
addEntry(long ledgerId,
byte[] masterKey,
long entryId,
ByteBuffer entry,
WriteCallback cb,
Object ctx)
Send addEntry operation to bookie. |
void |
errorOut()
Errors out pending entries. |
MessageDigest |
getDigestInstance(String alg)
Get digest instance if there is none. |
Mac |
getMac(String alg,
byte[] key)
|
void |
halt()
Halts client. |
boolean |
isConnected()
Returns the status of the socket of this bookie client. |
static void |
main(String[] args)
|
void |
readEntry(long ledgerId,
long entryId,
ReadEntryCallback cb,
Object ctx)
Send readEntry operation to bookie. |
void |
run()
|
void |
startConnection(InetSocketAddress addr,
int recvTimeout)
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BookieClient(InetSocketAddress addr,
int recvTimeout)
throws IOException,
ConnectException
IOException
ConnectException
public BookieClient(String host,
int port,
int recvTimeout)
throws IOException,
ConnectException
IOException
ConnectException| Method Detail |
|---|
public void startConnection(InetSocketAddress addr,
int recvTimeout)
throws IOException,
ConnectException
IOException
ConnectException
public MessageDigest getDigestInstance(String alg)
throws NoSuchAlgorithmException
NoSuchAlgorithmException
public Mac getMac(String alg,
byte[] key)
throws NoSuchAlgorithmException,
InvalidKeyException
NoSuchAlgorithmException
InvalidKeyException
public void addEntry(long ledgerId,
byte[] masterKey,
long entryId,
ByteBuffer entry,
WriteCallback cb,
Object ctx)
throws IOException,
InterruptedException
ledgerId - ledger identifierentryId - entry identifiercb - object implementing callback methodctx - control object
IOException
InterruptedException
public void readEntry(long ledgerId,
long entryId,
ReadEntryCallback cb,
Object ctx)
throws IOException,
InterruptedException
ledgerId - ledger identifierentryId - entry identifiercb - object implementing callback methodctx - control object
IOException
InterruptedExceptionpublic void run()
run in interface Runnablerun in class Threadpublic void errorOut()
public void halt()
public boolean isConnected()
public static void main(String[] args)
throws NumberFormatException,
IOException,
InterruptedException
args -
IOException
NumberFormatException
InterruptedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||