public interface MemcachedNode
Modifier and Type | Method and Description |
---|---|
void |
addOp(Operation op)
Add an operation to the queue.
|
void |
authComplete()
Let the node know that auth is complete.
|
void |
completedRead()
Notify node of successful read.
|
void |
connected()
Notify this node that it has reconnected.
|
void |
copyInputQueue()
Move all of the operations delivered via addOperation into the internal
write queue.
|
java.util.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.
|
java.nio.channels.SocketChannel |
getChannel()
Get the SocketChannel for this connection.
|
int |
getContinuousTimeout() |
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.
|
java.nio.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.
|
java.nio.channels.SelectionKey |
getSk()
Get the selection key from this node.
|
java.net.SocketAddress |
getSocketAddress()
Get the SocketAddress of the server to which this node is connected.
|
java.nio.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.
|
void |
insertOp(Operation o)
Insert an operation to the beginning of the queue.
|
boolean |
isActive()
True if this node is
active.i.e. |
boolean |
isAuthenticated()
True if this node is
authenticated. |
long |
lastReadDelta()
Milliseconds since last successful read.
|
void |
reconnecting()
Notify this node that it will be reconnecting.
|
void |
registerChannel(java.nio.channels.SocketChannel ch,
java.nio.channels.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(java.nio.channels.SocketChannel to)
Set the SocketChannel this node uses.
|
void |
setContinuousTimeout(boolean timedOut)
Count 'time out' exceptions to drop connections that fail perpetually.
|
void |
setSk(java.nio.channels.SelectionKey to)
Set the selection key for this node.
|
void |
setupForAuth()
Tell a node to set up for authentication.
|
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.
|
void copyInputQueue()
java.util.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)
void insertOp(Operation o)
int getSelectionOps()
java.nio.ByteBuffer getRbuf()
java.nio.ByteBuffer getWbuf()
java.net.SocketAddress getSocketAddress()
boolean isActive()
active.i.e. is is currently connected and expected to be able to process requests
boolean isAuthenticated()
authenticated.
long lastReadDelta()
void completedRead()
void reconnecting()
void connected()
int getReconnectCount()
void registerChannel(java.nio.channels.SocketChannel ch, java.nio.channels.SelectionKey selectionKey)
void setChannel(java.nio.channels.SocketChannel to)
java.nio.channels.SocketChannel getChannel()
void setSk(java.nio.channels.SelectionKey to)
java.nio.channels.SelectionKey getSk()
int getBytesRemainingToWrite()
int writeSome() throws java.io.IOException
java.io.IOException
- if there's a problem writingvoid fixupOps()
void authComplete()
void setupForAuth()
void setContinuousTimeout(boolean timedOut)
timedOut
- int getContinuousTimeout()
Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.