voldemort.store.socket.clientrequest
Class ClientRequestExecutor
java.lang.Object
voldemort.utils.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
|
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 |
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(java.nio.channels.SelectionKey selectionKey)
addClientRequest
public void addClientRequest(ClientRequest<?> clientRequest)
addClientRequest
public void addClientRequest(ClientRequest<?> clientRequest,
long timeoutMs)
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