Package org.apache.hadoop.ipc
Class ProtobufRpcEngine2.Invoker
java.lang.Object
org.apache.hadoop.ipc.ProtobufRpcEngine2.Invoker
- All Implemented Interfaces:
Closeable,AutoCloseable,InvocationHandler,RpcInvocationHandler
- Enclosing class:
- ProtobufRpcEngine2
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInvoker(Class<?> protocol, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, AtomicBoolean fallbackToSimpleAuth, AlignmentContext alignmentContext) protectedInvoker(Class<?> protocol, Client.ConnectionId connId, Configuration conf, SocketFactory factory, AlignmentContext alignmentContext) This constructor takes a connectionId, instead of creating a new one. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected WritableconstructRpcRequest(Method method, org.apache.hadoop.thirdparty.protobuf.Message theRequest) protected longReturns the connection id associated with the InvocationHandler instance.protected Stringorg.apache.hadoop.thirdparty.protobuf.MessageThis is the client side invoker of RPC method.
-
Constructor Details
-
Invoker
protected Invoker(Class<?> protocol, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, AtomicBoolean fallbackToSimpleAuth, AlignmentContext alignmentContext) throws IOException - Throws:
IOException
-
Invoker
protected Invoker(Class<?> protocol, Client.ConnectionId connId, Configuration conf, SocketFactory factory, AlignmentContext alignmentContext) This constructor takes a connectionId, instead of creating a new one.- Parameters:
protocol- input protocol.connId- input connId.conf- input Configuration.factory- input factory.alignmentContext- Alignment context
-
-
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:- Exceptions encountered on the client side in this method are set as cause in ServiceException as is.
- Exceptions from the server are wrapped in RemoteException and are set as cause in ServiceException
- Specified by:
invokein interfaceInvocationHandler- Throws:
org.apache.hadoop.thirdparty.protobuf.ServiceException
-
constructRpcRequest
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getConnectionId
Description copied from interface:RpcInvocationHandlerReturns the connection id associated with the InvocationHandler instance.- Specified by:
getConnectionIdin interfaceRpcInvocationHandler- Returns:
- ConnectionId
-
getClientProtocolVersion
protected long getClientProtocolVersion() -
getProtocolName
-