voldemort.store.socket.clientrequest
Class ClientRequestExecutor
java.lang.Object
voldemort.common.nio.SelectorManagerWorker
voldemort.store.socket.clientrequest.ClientRequestExecutor
- All Implemented Interfaces:
- java.lang.Runnable
public class ClientRequestExecutor
- extends SelectorManagerWorker
ClientRequestExecutor represents a persistent link between a client and
server and is used by the ClientRequestExecutorPool
to execute
requests
for the client.
Instances are maintained in a pool by ClientRequestExecutorPool
using
a checkout/checkin pattern. When an instance is checked out, the calling code
has exclusive access to that instance. Then the
request can be executed
.
- See Also:
SelectorManagerWorker
,
ClientRequestExecutorPool
Field Summary |
protected java.nio.ByteBuffer |
buffer
|
Constructor Summary |
ClientRequestExecutor(java.nio.channels.Selector selector,
java.nio.channels.SocketChannel socketChannel,
int socketBufferSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buffer
protected java.nio.ByteBuffer buffer
ClientRequestExecutor
public ClientRequestExecutor(java.nio.channels.Selector selector,
java.nio.channels.SocketChannel socketChannel,
int socketBufferSize)
getSocketChannel
public java.nio.channels.SocketChannel getSocketChannel()
isValid
public boolean isValid()
checkTimeout
public boolean checkTimeout()
addClientRequest
public void addClientRequest(ClientRequest<?> clientRequest,
long timeoutMs,
long elapsedNs)
initializeStreams
protected void initializeStreams(int socketBufferSize,
CommBufferSizeStats commBufferStats)
- Specified by:
initializeStreams
in class SelectorManagerWorker
close
public void close()
- Overrides:
close
in class SelectorManagerWorker
read
protected void read(java.nio.channels.SelectionKey selectionKey)
throws java.io.IOException
- Specified by:
read
in class SelectorManagerWorker
- Throws:
java.io.IOException
write
protected void write(java.nio.channels.SelectionKey selectionKey)
throws java.io.IOException
- Specified by:
write
in class SelectorManagerWorker
- Throws:
java.io.IOException
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu