Package org.apache.drill.exec.rpc
Class RpcBus<T extends com.google.protobuf.Internal.EnumLite,C extends RemoteConnection>
java.lang.Object
org.apache.drill.exec.rpc.RpcBus<T,C>
- Type Parameters:
T
- RPC typeC
- Remote connection type
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
BasicClient
,BasicServer
public abstract class RpcBus<T extends com.google.protobuf.Internal.EnumLite,C extends RemoteConnection>
extends Object
implements Closeable
The Rpc Bus deals with incoming and outgoing communication and is used on both the server and the client side of a
system.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
protected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected SocketAddress
protected SocketAddress
protected final RpcConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
get
(io.netty.buffer.ByteBuf pBody, com.google.protobuf.Parser<T> parser) protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>
getCloseHandler
(io.netty.channel.socket.SocketChannel channel, C clientConnection) protected abstract com.google.protobuf.MessageLite
getResponseDefaultInstance
(int rpcType) protected abstract void
handle
(C connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) protected abstract C
initRemoteConnection
(io.netty.channel.socket.SocketChannel channel) <SEND extends com.google.protobuf.MessageLite,
RECEIVE extends com.google.protobuf.MessageLite>
DrillRpcFuture<RECEIVE>send
(C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, io.netty.buffer.ByteBuf... dataBodies) <SEND extends com.google.protobuf.MessageLite,
RECEIVE extends com.google.protobuf.MessageLite>
voidsend
(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, boolean allowInEventLoop, io.netty.buffer.ByteBuf... dataBodies) <SEND extends com.google.protobuf.MessageLite,
RECEIVE extends com.google.protobuf.MessageLite>
voidsend
(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, io.netty.buffer.ByteBuf... dataBodies) protected void
setAddresses
(SocketAddress remote, SocketAddress local)
-
Field Details
-
rpcConfig
-
local
-
remote
-
-
Constructor Details
-
RpcBus
-
-
Method Details
-
getResponseDefaultInstance
protected abstract com.google.protobuf.MessageLite getResponseDefaultInstance(int rpcType) throws RpcException - Throws:
RpcException
-
handle
protected abstract void handle(C connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException - Throws:
RpcException
-
setAddresses
-
send
public <SEND extends com.google.protobuf.MessageLite,RECEIVE extends com.google.protobuf.MessageLite> DrillRpcFuture<RECEIVE> send(C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, io.netty.buffer.ByteBuf... dataBodies) -
send
public <SEND extends com.google.protobuf.MessageLite,RECEIVE extends com.google.protobuf.MessageLite> void send(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, io.netty.buffer.ByteBuf... dataBodies) -
send
public <SEND extends com.google.protobuf.MessageLite,RECEIVE extends com.google.protobuf.MessageLite> void send(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, boolean allowInEventLoop, io.netty.buffer.ByteBuf... dataBodies) -
initRemoteConnection
-
getCloseHandler
protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture> getCloseHandler(io.netty.channel.socket.SocketChannel channel, C clientConnection) -
get
public static <T> T get(io.netty.buffer.ByteBuf pBody, com.google.protobuf.Parser<T> parser) throws RpcException - Throws:
RpcException
-