voldemort.server.protocol
Interface RequestHandler

All Known Implementing Classes:
AbstractRequestHandler, AdminServiceRequestHandler, ProtoBuffRequestHandler, VoldemortNativeRequestHandler

public interface RequestHandler

A request handler that answers client requests in some given format


Method Summary
 StreamRequestHandler handleRequest(java.io.DataInputStream inputStream, java.io.DataOutputStream outputStream)
          Handles the request as determined by the protocol and command provided as input.
 boolean isCompleteRequest(java.nio.ByteBuffer buffer)
          This method is used by non-blocking code to determine if the give buffer represents a complete request.
 

Method Detail

handleRequest

StreamRequestHandler handleRequest(java.io.DataInputStream inputStream,
                                   java.io.DataOutputStream outputStream)
                                   throws java.io.IOException
Handles the request as determined by the protocol and command provided as input.

Parameters:
inputStream -
outputStream -
Returns:
StreamRequestHandler if this is the beginning of a streaming request, null if self-contained
Throws:
java.io.IOException

isCompleteRequest

boolean isCompleteRequest(java.nio.ByteBuffer buffer)
This method is used by non-blocking code to determine if the give buffer represents a complete request. Because the non-blocking code can by definition not just block waiting for more data, it's possible to get partial reads, and this identifies that case.

Parameters:
buffer - Buffer to check; the buffer is reset to position 0 before calling this method and the caller must reset it after the call returns
Returns:
True if the buffer holds a complete request, false otherwise


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu