org.apache.bookkeeper.client
Class QuorumOpMonitor

java.lang.Object
  extended by org.apache.bookkeeper.client.QuorumOpMonitor
All Implemented Interfaces:
ReadEntryCallback, WriteCallback

public class QuorumOpMonitor
extends Object
implements WriteCallback, ReadEntryCallback

Monitors reponses from bookies to requests of a client. It implements two interfaces of the proto package that correspond to callbacks from BookieClient objects.


Nested Class Summary
static class QuorumOpMonitor.PendingOp
           
static class QuorumOpMonitor.PendingReadOp
          Objects of this type are used to keep track of the status of a given read request.
 
Method Summary
 void readEntryComplete(int rc, long ledgerId, long entryId, ByteBuffer bb, Object ctx)
          Callback method for read operations.
 void writeComplete(int rc, long ledgerId, long entryId, Object ctx)
          Callback method for write operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeComplete

public void writeComplete(int rc,
                          long ledgerId,
                          long entryId,
                          Object ctx)
Callback method for write operations. There is one callback for each write to a server.

Specified by:
writeComplete in interface WriteCallback

readEntryComplete

public void readEntryComplete(int rc,
                              long ledgerId,
                              long entryId,
                              ByteBuffer bb,
                              Object ctx)
Callback method for read operations. There is one callback for each entry of a read request. TODO: We might want to change the way a client application specify the quorum size. It is really loose now, and it allows an application to set any quorum size the client wants.

Specified by:
readEntryComplete in interface ReadEntryCallback