Class ProtobufRpcEngine2.Invoker

java.lang.Object
org.apache.hadoop.ipc.ProtobufRpcEngine2.Invoker
All Implemented Interfaces:
Closeable, AutoCloseable, InvocationHandler, RpcInvocationHandler
Enclosing class:
ProtobufRpcEngine2

protected static class ProtobufRpcEngine2.Invoker extends Object implements RpcInvocationHandler
  • Constructor Details

  • Method Details

    • invoke

      public org.apache.hadoop.thirdparty.protobuf.Message invoke(Object proxy, Method method, Object[] args) throws org.apache.hadoop.thirdparty.protobuf.ServiceException
      This is the client side invoker of RPC method. It only throws ServiceException, since the invocation proxy expects only ServiceException to be thrown by the method in case protobuf service. ServiceException has the following causes:
      1. Exceptions encountered on the client side in this method are set as cause in ServiceException as is.
      2. Exceptions from the server are wrapped in RemoteException and are set as cause in ServiceException
      Note that the client calling protobuf RPC methods, must handle ServiceException by getting the cause from the ServiceException. If the cause is RemoteException, then unwrap it to get the exception thrown by the server.
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      org.apache.hadoop.thirdparty.protobuf.ServiceException
    • constructRpcRequest

      protected Writable constructRpcRequest(Method method, org.apache.hadoop.thirdparty.protobuf.Message theRequest)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getConnectionId

      public Client.ConnectionId getConnectionId()
      Description copied from interface: RpcInvocationHandler
      Returns the connection id associated with the InvocationHandler instance.
      Specified by:
      getConnectionId in interface RpcInvocationHandler
      Returns:
      ConnectionId
    • getClientProtocolVersion

      protected long getClientProtocolVersion()
    • getProtocolName

      protected String getProtocolName()