public class MemcachedNodeROImpl extends java.lang.Object implements MemcachedNode
| Constructor and Description |
|---|
MemcachedNodeROImpl(MemcachedNode n) |
| 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.nio.ByteBuffer |
decryptNextTLSDataRecord(java.nio.ByteBuffer rbuf)
Convert the encrypted data record that received from this node to plain text data.
|
java.util.Collection<Operation> |
destroyInputQueue()
Extract all queued items for this node destructively.
|
boolean |
doTlsHandshake(long timeoutInMillis)
Do handshake for connecting to this node when TLS enabled.
|
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.
|
MemcachedConnection |
getConnection() |
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.
|
NodeEndPoint |
getNodeEndPoint()
Get NodeEndPoint
|
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 op)
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 |
setConnection(MemcachedConnection connection) |
void |
setContinuousTimeout(boolean isIncrease)
Count 'time out' exceptions to drop connections that fail perpetually.
|
void |
setNodeEndPoint(NodeEndPoint endPoint)
Set NodeEndPoint
|
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.
|
java.lang.String |
toString() |
void |
transitionWriteItem()
Transition the current write item into a read state.
|
int |
writeSome()
Write some bytes and return the number of bytes written.
|
public MemcachedNodeROImpl(MemcachedNode n)
public java.lang.String toString()
toString in class java.lang.Objectpublic void addOp(Operation op)
MemcachedNodeaddOp in interface MemcachedNodepublic void insertOp(Operation op)
MemcachedNodeinsertOp in interface MemcachedNodepublic void connected()
MemcachedNodeconnected in interface MemcachedNodepublic void copyInputQueue()
MemcachedNodecopyInputQueue in interface MemcachedNodepublic void fillWriteBuffer(boolean optimizeGets)
throws java.io.IOException
MemcachedNodefillWriteBuffer in interface MemcachedNodeoptimizeGets - if true, combine sequential gets into a single
multi-key getjava.io.IOExceptionpublic void fixupOps()
MemcachedNodefixupOps in interface MemcachedNodepublic int getBytesRemainingToWrite()
MemcachedNodegetBytesRemainingToWrite in interface MemcachedNodepublic java.nio.channels.SocketChannel getChannel()
MemcachedNodegetChannel in interface MemcachedNodepublic Operation getCurrentReadOp()
MemcachedNodegetCurrentReadOp in interface MemcachedNodepublic Operation getCurrentWriteOp()
MemcachedNodegetCurrentWriteOp in interface MemcachedNodepublic java.nio.ByteBuffer getRbuf()
MemcachedNodegetRbuf in interface MemcachedNodepublic int getReconnectCount()
MemcachedNodegetReconnectCount in interface MemcachedNodepublic int getSelectionOps()
MemcachedNodegetSelectionOps in interface MemcachedNodepublic java.nio.channels.SelectionKey getSk()
MemcachedNodegetSk in interface MemcachedNodepublic java.net.SocketAddress getSocketAddress()
MemcachedNodegetSocketAddress in interface MemcachedNodepublic NodeEndPoint getNodeEndPoint()
MemcachedNodegetNodeEndPoint in interface MemcachedNodepublic void setNodeEndPoint(NodeEndPoint endPoint)
MemcachedNodesetNodeEndPoint in interface MemcachedNodepublic boolean doTlsHandshake(long timeoutInMillis)
throws java.io.IOException
MemcachedNodedoTlsHandshake in interface MemcachedNodejava.io.IOExceptionpublic java.nio.ByteBuffer decryptNextTLSDataRecord(java.nio.ByteBuffer rbuf)
throws java.io.IOException
MemcachedNodedecryptNextTLSDataRecord in interface MemcachedNodejava.io.IOExceptionpublic java.nio.ByteBuffer getWbuf()
MemcachedNodegetWbuf in interface MemcachedNodepublic boolean hasReadOp()
MemcachedNodehasReadOp in interface MemcachedNodepublic boolean hasWriteOp()
MemcachedNodehasWriteOp in interface MemcachedNodepublic boolean isActive()
MemcachedNodeactive.i.e. is is currently connected and expected to be able to process requests
isActive in interface MemcachedNodepublic void reconnecting()
MemcachedNodereconnecting in interface MemcachedNodepublic void registerChannel(java.nio.channels.SocketChannel ch,
java.nio.channels.SelectionKey selectionKey)
MemcachedNoderegisterChannel in interface MemcachedNodepublic Operation removeCurrentReadOp()
MemcachedNoderemoveCurrentReadOp in interface MemcachedNodepublic Operation removeCurrentWriteOp()
MemcachedNoderemoveCurrentWriteOp in interface MemcachedNodepublic void setChannel(java.nio.channels.SocketChannel to)
MemcachedNodesetChannel in interface MemcachedNodepublic void setSk(java.nio.channels.SelectionKey to)
MemcachedNodesetSk in interface MemcachedNodepublic void setupResend()
MemcachedNodesetupResend in interface MemcachedNodepublic void transitionWriteItem()
MemcachedNodetransitionWriteItem in interface MemcachedNodepublic int writeSome()
throws java.io.IOException
MemcachedNodewriteSome in interface MemcachedNodejava.io.IOException - if there's a problem writingpublic java.util.Collection<Operation> destroyInputQueue()
MemcachedNodedestroyInputQueue in interface MemcachedNodepublic void authComplete()
MemcachedNodeauthComplete in interface MemcachedNodepublic void setupForAuth()
MemcachedNodesetupForAuth in interface MemcachedNodepublic int getContinuousTimeout()
getContinuousTimeout in interface MemcachedNodepublic void setContinuousTimeout(boolean isIncrease)
MemcachedNodesetContinuousTimeout in interface MemcachedNodepublic boolean isAuthenticated()
MemcachedNodeauthenticated.
isAuthenticated in interface MemcachedNodepublic long lastReadDelta()
MemcachedNodelastReadDelta in interface MemcachedNodepublic void completedRead()
MemcachedNodecompletedRead in interface MemcachedNodepublic MemcachedConnection getConnection()
getConnection in interface MemcachedNodepublic void setConnection(MemcachedConnection connection)
setConnection in interface MemcachedNodeCopyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.