|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MemcachedNode
Interface defining a connection to a memcached server.
Method Summary | |
---|---|
void |
addOp(Operation op)
Add an operation to the queue. |
void |
connected()
Notify this node that it has reconnected. |
void |
copyInputQueue()
Move all of the operations delivered via addOperation into the internal write queue. |
Collection<Operation> |
destroyInputQueue()
Extract all queued items for this node destructively. |
void |
fillWriteBuffer(boolean optimizeGets)
Fill the write buffer with data from the next operations in the queue. |
void |
fixupOps()
Fix up the selection ops on the selection key. |
int |
getBytesRemainingToWrite()
Get the number of bytes remaining to write. |
SocketChannel |
getChannel()
Get the SocketChannel for this connection. |
Operation |
getCurrentReadOp()
Get the operation at the top of the queue that is requiring input. |
Operation |
getCurrentWriteOp()
Get the operation at the top of the queue that has information available to write. |
ByteBuffer |
getRbuf()
Get the buffer used for reading data from this node. |
int |
getReconnectCount()
Get the current reconnect count. |
int |
getSelectionOps()
Compute the appropriate selection operations for the channel this MemcachedNode holds to the server. |
SelectionKey |
getSk()
Get the selection key from this node. |
SocketAddress |
getSocketAddress()
Get the SocketAddress of the server to which this node is connected. |
ByteBuffer |
getWbuf()
Get the buffer used for writing data to this node. |
boolean |
hasReadOp()
True if an operation is available to read. |
boolean |
hasWriteOp()
True if an operation is available to write. |
boolean |
isActive()
True if this node is active.i.e. |
void |
reconnecting()
Notify this node that it will be reconnecting. |
void |
registerChannel(SocketChannel ch,
SelectionKey selectionKey)
Register a channel with this node. |
Operation |
removeCurrentReadOp()
Remove the operation at the top of the queue that is requiring input. |
Operation |
removeCurrentWriteOp()
Remove the operation at the top of the queue that has information available to write. |
void |
setChannel(SocketChannel to)
Set the SocketChannel this node uses. |
void |
setSk(SelectionKey to)
Set the selection key for this node. |
void |
setupResend()
Clear the queue of currently processing operations by either cancelling them or setting them up to be reapplied after a reconnect. |
void |
transitionWriteItem()
Transition the current write item into a read state. |
int |
writeSome()
Write some bytes and return the number of bytes written. |
Method Detail |
---|
void copyInputQueue()
Collection<Operation> destroyInputQueue()
void setupResend()
void fillWriteBuffer(boolean optimizeGets)
optimizeGets
- if true, combine sequential gets into a single
multi-key getvoid transitionWriteItem()
Operation getCurrentReadOp()
Operation removeCurrentReadOp()
Operation getCurrentWriteOp()
Operation removeCurrentWriteOp()
boolean hasReadOp()
boolean hasWriteOp()
void addOp(Operation op)
int getSelectionOps()
ByteBuffer getRbuf()
ByteBuffer getWbuf()
SocketAddress getSocketAddress()
boolean isActive()
active.i.e. is is currently connected and expected to be able to process requests
void reconnecting()
void connected()
int getReconnectCount()
void registerChannel(SocketChannel ch, SelectionKey selectionKey)
void setChannel(SocketChannel to)
SocketChannel getChannel()
void setSk(SelectionKey to)
SelectionKey getSk()
int getBytesRemainingToWrite()
int writeSome() throws IOException
IOException
- if there's a problem writingvoid fixupOps()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |