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 type
C - 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

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     
    protected class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected SocketAddress
     
    protected SocketAddress
     
    protected final RpcConfig
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RpcBus(RpcConfig rpcConfig)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <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
     
    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>
    void
    send(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>
    void
    send(RpcOutcomeListener<RECEIVE> listener, C connection, T rpcType, SEND protobufBody, Class<RECEIVE> clazz, io.netty.buffer.ByteBuf... dataBodies)
     
    protected void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.io.Closeable

    close
  • Field Details

  • Constructor Details

    • RpcBus

      public RpcBus(RpcConfig rpcConfig)
  • 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

      protected void setAddresses(SocketAddress remote, SocketAddress local)
    • 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

      protected abstract C initRemoteConnection(io.netty.channel.socket.SocketChannel channel)
    • 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