Package org.apache.drill.exec.rpc
Class BasicServer<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>
java.lang.Object
org.apache.drill.exec.rpc.RpcBus<T,SC>
org.apache.drill.exec.rpc.BasicServer<T,SC>
- Type Parameters:
T- RPC typeSC- server connection type
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ControlServer,DataServer,UserServer
public abstract class BasicServer<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>
extends RpcBus<T,SC>
A server is bound to a port and is responsible for responding to various type of requests. In some cases,
the inbound requests will generate more than one outbound request.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classBasicServer.ServerHandshakeHandler<T extends com.google.protobuf.MessageLite>Nested classes/interfaces inherited from class org.apache.drill.exec.rpc.RpcBus
RpcBus.ChannelClosedHandler, RpcBus.InboundHandler -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBasicServer(RpcConfig rpcMapping, io.netty.buffer.ByteBufAllocator alloc, io.netty.channel.EventLoopGroup eventLoopGroup) -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()protected voidcloseSSL()protected abstract ProtobufLengthDecodergetDecoder(BufferAllocator allocator, OutOfMemoryHandler outOfMemoryHandler) protected abstract BasicServer.ServerHandshakeHandler<?> getHandshakeHandler(SC connection) protected OutOfMemoryHandlerprotected abstract com.google.protobuf.MessageLitegetResponseDefaultInstance(int rpcType) protected voidhandle(SC connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) protected SCinitRemoteConnection(io.netty.channel.socket.SocketChannel channel) protected booleanvoidsetSslChannel(io.netty.channel.Channel c) protected voidsetupSSL(io.netty.channel.ChannelPipeline pipe) Methods inherited from class org.apache.drill.exec.rpc.RpcBus
get, getCloseHandler, send, send, send, setAddresses
-
Constructor Details
-
BasicServer
public BasicServer(RpcConfig rpcMapping, io.netty.buffer.ByteBufAllocator alloc, io.netty.channel.EventLoopGroup eventLoopGroup)
-
-
Method Details
-
setupSSL
protected void setupSSL(io.netty.channel.ChannelPipeline pipe) -
isSslEnabled
protected boolean isSslEnabled() -
setSslChannel
public void setSslChannel(io.netty.channel.Channel c) -
closeSSL
protected void closeSSL() -
getOutOfMemoryHandler
-
getDecoder
protected abstract ProtobufLengthDecoder getDecoder(BufferAllocator allocator, OutOfMemoryHandler outOfMemoryHandler) -
getHandshakeHandler
-
getResponseDefaultInstance
protected abstract com.google.protobuf.MessageLite getResponseDefaultInstance(int rpcType) throws RpcException - Specified by:
getResponseDefaultInstancein classRpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>> - Throws:
RpcException
-
handle
protected void handle(SC connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException - Specified by:
handlein classRpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>> - Throws:
RpcException
-
initRemoteConnection
- Specified by:
initRemoteConnectionin classRpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>
-
bind
-
close
- Throws:
IOException
-