Package org.apache.drill.exec.rpc
Class FailingRequestHandler<S extends ServerConnection<S>>
java.lang.Object
org.apache.drill.exec.rpc.FailingRequestHandler<S>
- Type Parameters:
S
- server connection type
- All Implemented Interfaces:
RequestHandler<S>
public class FailingRequestHandler<S extends ServerConnection<S>>
extends Object
implements RequestHandler<S>
This handler fails any request on the connection. Example use case: the peer is making requests
before authenticating.
-
Constructor Summary
-
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.
-
Constructor Details
-
FailingRequestHandler
public FailingRequestHandler()
-
-
Method Details
-
handle
public void handle(S connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException Description copied from interface:RequestHandler
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- Specified by:
handle
in interfaceRequestHandler<S extends ServerConnection<S>>
- Parameters:
connection
- remote connectionrpcType
- rpc typepBody
- messagedBody
- data, maybe nullsender
- used tosend
the response- Throws:
RpcException
-