Package org.apache.drill.exec.rpc
Interface RequestHandler<S extends ServerConnection<S>>
- Type Parameters:
S
- server connection type
- All Known Implementing Classes:
ControlMessageHandler
,FailingRequestHandler
,ServerAuthenticationHandler
public interface RequestHandler<S extends ServerConnection<S>>
Note that if a handler maintains any internal state, the state will be disposed if the handler on the connection
changes. So handler should not maintain state.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(S connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) Handle request of given type (rpcType) with message (pBody) and optional data (dBody) on the connection, and return the appropriate response.
-
Method Details
-
handle
void handle(S connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException Handle request of given type (rpcType) with message (pBody) and optional data (dBody) on the connection, and return the appropriate response. The method must do one of three things: + usesend
the response + throw UserRpcException, in which case a response will be sent usingsend
+ throw an Exception, in which case, the connection will be dropped- Parameters:
connection
- remote connectionrpcType
- rpc typepBody
- messagedBody
- data, maybe nullsender
- used tosend
the response- Throws:
RpcException
-