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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(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:RequestHandlerHandle 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: + usesendthe 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:
handlein interfaceRequestHandler<S extends ServerConnection<S>>- Parameters:
connection- remote connectionrpcType- rpc typepBody- messagedBody- data, maybe nullsender- used tosendthe response- Throws:
RpcException
-