voldemort.server.niosocket
Class AsyncRequestHandler
java.lang.Object
voldemort.common.nio.SelectorManagerWorker
voldemort.server.niosocket.AsyncRequestHandler
- All Implemented Interfaces:
- java.lang.Runnable
public class AsyncRequestHandler
- extends SelectorManagerWorker
AsyncRequestHandler manages a Selector, SocketChannel, and RequestHandler
implementation. At the point that the run method is invoked, the Selector
with which the (socket) Channel has been registered has notified us that the
socket has data to read or write.
The bulk of the complexity in this class surrounds partial reads and writes,
as well as determining when all the data needed for the request has been
read.
- See Also:
RequestHandler
|
Method Summary |
void |
close()
|
protected void |
read(java.nio.channels.SelectionKey selectionKey)
|
protected void |
write(java.nio.channels.SelectionKey selectionKey)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncRequestHandler
public AsyncRequestHandler(java.nio.channels.Selector selector,
java.nio.channels.SocketChannel socketChannel,
RequestHandlerFactory requestHandlerFactory,
int socketBufferSize,
NioSelectorManagerStats nioStats)
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
close
public void close()
- Overrides:
close in class SelectorManagerWorker
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu