Package org.apache.hadoop.ipc
Interface RpcEngine
- All Known Implementing Classes:
ProtobufRpcEngine,ProtobufRpcEngine2,WritableRpcEngine
@Evolving
public interface RpcEngine
An RPC implementation.
-
Method Summary
Modifier and TypeMethodDescriptiongetProtocolMetaInfoProxy(Client.ConnectionId connId, Configuration conf, SocketFactory factory) Returns a proxy for ProtocolMetaInfoPB, which uses the given connection id.<T> ProtocolProxy<T>getProxy(Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy) Construct a client-side proxy object.<T> ProtocolProxy<T>getProxy(Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, AtomicBoolean fallbackToSimpleAuth, AlignmentContext alignmentContext) Construct a client-side proxy object.<T> ProtocolProxy<T>getProxy(Class<T> protocol, long clientVersion, Client.ConnectionId connId, Configuration conf, SocketFactory factory, AlignmentContext alignmentContext) Construct a client-side proxy object with a ConnectionId.getServer(Class<?> protocol, Object instance, String bindAddress, int port, int numHandlers, int numReaders, int queueSizePerHandler, boolean verbose, Configuration conf, SecretManager<? extends TokenIdentifier> secretManager, String portRangeConfig, AlignmentContext alignmentContext) Construct a server for a protocol implementation instance.
-
Method Details
-
getProxy
<T> ProtocolProxy<T> getProxy(Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy) throws IOException Construct a client-side proxy object.- Type Parameters:
T- Generics Type T.- Parameters:
protocol- input protocol.clientVersion- input clientVersion.addr- input addr.ticket- input ticket.conf- input Configuration.factory- input factory.rpcTimeout- input rpcTimeout.connectionRetryPolicy- input connectionRetryPolicy.- Returns:
- ProtocolProxy.
- Throws:
IOException- raised on errors performing I/O.
-
getProxy
<T> ProtocolProxy<T> getProxy(Class<T> protocol, long clientVersion, Client.ConnectionId connId, Configuration conf, SocketFactory factory, AlignmentContext alignmentContext) throws IOException Construct a client-side proxy object with a ConnectionId.- Type Parameters:
T- Generics Type T.- Parameters:
protocol- input protocol.clientVersion- input clientVersion.connId- input ConnectionId.conf- input Configuration.factory- input factory.alignmentContext- Alignment context- Returns:
- ProtocolProxy.
- Throws:
IOException- raised on errors performing I/O.
-
getProxy
<T> ProtocolProxy<T> getProxy(Class<T> protocol, long clientVersion, InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, AtomicBoolean fallbackToSimpleAuth, AlignmentContext alignmentContext) throws IOException Construct a client-side proxy object.- Type Parameters:
T- Generics Type T.- Parameters:
protocol- input protocol.clientVersion- input clientVersion.addr- input addr.ticket- input tocket.conf- input Configuration.factory- input factory.rpcTimeout- input rpcTimeout.connectionRetryPolicy- input connectionRetryPolicy.fallbackToSimpleAuth- input fallbackToSimpleAuth.alignmentContext- input alignmentContext.- Returns:
- ProtocolProxy.
- Throws:
IOException- raised on errors performing I/O.
-
getServer
RPC.Server getServer(Class<?> protocol, Object instance, String bindAddress, int port, int numHandlers, int numReaders, int queueSizePerHandler, boolean verbose, Configuration conf, SecretManager<? extends TokenIdentifier> secretManager, String portRangeConfig, AlignmentContext alignmentContext) throws IOException Construct a server for a protocol implementation instance.- Parameters:
protocol- the class of protocol to useinstance- the instance of protocol whose methods will be calledconf- the configuration to usebindAddress- the address to bind on to listen for connectionport- the port to listen for connections onnumHandlers- the number of method handler threads to runnumReaders- the number of reader threads to runqueueSizePerHandler- the size of the queue per hander threadverbose- whether each call should be loggedsecretManager- The secret manager to use to validate incoming requests.portRangeConfig- A config parameter that can be used to restrict the range of ports used when port is 0 (an ephemeral port)alignmentContext- provides server state info on client responses- Returns:
- The Server instance
- Throws:
IOException- on any error
-
getProtocolMetaInfoProxy
ProtocolProxy<ProtocolMetaInfoPB> getProtocolMetaInfoProxy(Client.ConnectionId connId, Configuration conf, SocketFactory factory) throws IOException Returns a proxy for ProtocolMetaInfoPB, which uses the given connection id.- Parameters:
connId- , ConnectionId to be used for the proxy.conf- , Configuration.factory- , Socket factory.- Returns:
- Proxy object.
- Throws:
IOException- raised on errors performing I/O.
-