@LimitedPrivate({"Common","HDFS","MapReduce","Yarn"})
@Evolving
public class RPC
extends java.lang.Object
boolean, byte,
char, short, int, long,
float, double, or void; orString; orWritable; or| Modifier and Type | Class | Description |
|---|---|---|
static class |
RPC.Builder |
Class to construct instances of RPC server with specific options.
|
static class |
RPC.RpcKind |
|
static class |
RPC.Server |
An RPC Server.
|
static class |
RPC.VersionMismatch |
A version mismatch for the RPC protocol.
|
| Modifier and Type | Method | Description |
|---|---|---|
static Client.ConnectionId |
getConnectionIdForProxy(java.lang.Object proxy) |
Return the connection ID of the given object.
|
static java.lang.String |
getProtocolName(java.lang.Class<?> protocol) |
Get the protocol name.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
javax.net.SocketFactory factory) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory,
int rpcTimeout,
RetryPolicy connectionRetryPolicy) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory,
int rpcTimeout,
RetryPolicy connectionRetryPolicy,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory,
int rpcTimeout,
RetryPolicy connectionRetryPolicy,
java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth,
AlignmentContext alignmentContext) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
Client.ConnectionId connId,
Configuration conf,
javax.net.SocketFactory factory) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
getProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
Client.ConnectionId connId,
Configuration conf,
javax.net.SocketFactory factory,
AlignmentContext alignmentContext) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static long |
getProtocolVersion(java.lang.Class<?> protocol) |
Get the protocol version from protocol class.
|
static <T> T |
getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf) |
Construct a client-side proxy object with the default SocketFactory.
|
static <T> T |
getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
javax.net.SocketFactory factory) |
Construct a client-side proxy object that implements the named protocol,
talking to a server at the named address.
|
static <T> T |
getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory) |
Construct a client-side proxy object that implements the named protocol,
talking to a server at the named address.
|
static <T> T |
getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory,
int rpcTimeout) |
Construct a client-side proxy that implements the named protocol,
talking to a server at the named address.
|
static int |
getRpcTimeout(Configuration conf) |
Get the RPC time from configuration;
If not set in the configuration, return the default value.
|
static java.net.InetSocketAddress |
getServerAddress(java.lang.Object proxy) |
|
static void |
setProtocolEngine(Configuration conf,
java.lang.Class<?> protocol,
java.lang.Class<?> engine) |
Set a protocol to use a non-default RpcEngine if one
is not specified in the configuration.
|
static void |
stopProxy(java.lang.Object proxy) |
Stop the proxy.
|
static <T> ProtocolProxy<T> |
waitForProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
waitForProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
int rpcTimeout,
RetryPolicy connectionRetryPolicy,
long timeout) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server.
|
static <T> ProtocolProxy<T> |
waitForProtocolProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
long connTimeout) |
Get a protocol proxy that contains a proxy connection to a remote server
and a set of methods that are supported by the server
|
static <T> T |
waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf) |
Get a proxy connection to a remote server.
|
static <T> T |
waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
int rpcTimeout,
long timeout) |
Get a proxy connection to a remote server.
|
static <T> T |
waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
long connTimeout) |
Get a proxy connection to a remote server.
|
public static java.lang.String getProtocolName(java.lang.Class<?> protocol)
protocol - input protocol.public static long getProtocolVersion(java.lang.Class<?> protocol)
protocol - input protocol.public static void setProtocolEngine(Configuration conf, java.lang.Class<?> protocol, java.lang.Class<?> engine)
conf - configuration to useprotocol - the protocol interfaceengine - the RpcEngine implpublic static <T> T waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf)
throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to usejava.io.IOException - if the far end through a RemoteExceptionpublic static <T> ProtocolProxy<T> waitForProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, Configuration conf) throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to usejava.io.IOException - if the far end through a RemoteExceptionpublic static <T> T waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
long connTimeout)
throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to useconnTimeout - time in milliseconds before giving upjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> ProtocolProxy<T> waitForProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, Configuration conf, long connTimeout) throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to useconnTimeout - time in milliseconds before giving upjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> T waitForProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
int rpcTimeout,
long timeout)
throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to userpcTimeout - timeout for each RPCtimeout - time in milliseconds before giving upjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> ProtocolProxy<T> waitForProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, Configuration conf, int rpcTimeout, RetryPolicy connectionRetryPolicy, long timeout) throws java.io.IOException
T - Generics Type.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to userpcTimeout - timeout for each RPCconnectionRetryPolicy - input connectionRetryPolicy.timeout - time in milliseconds before giving upjava.io.IOException - if the far end through a RemoteException.public static <T> T getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf,
javax.net.SocketFactory factory)
throws java.io.IOException
T - Generics Type T.protocol - input protocol.clientVersion - input clientVersion.addr - input addr.conf - input Configuration.factory - input factory.java.io.IOException - raised on errors performing I/O.public static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, Configuration conf, javax.net.SocketFactory factory) throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressconf - configuration to usefactory - socket factoryjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> T getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory)
throws java.io.IOException
T - Generics Type T.protocol - input protocol.clientVersion - input clientVersion.addr - input addr.ticket - input tocket.conf - input conf.factory - input factory.java.io.IOException - raised on errors performing I/O.public static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, javax.net.SocketFactory factory) throws java.io.IOException
T - Generics Type T.protocol - protocol classclientVersion - client versionaddr - remote addressticket - user group informationconf - configuration to usefactory - socket factoryjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, Client.ConnectionId connId, Configuration conf, javax.net.SocketFactory factory) throws java.io.IOException
T - Generics Type Tprotocol - protocol classclientVersion - client's versionconnId - client connection identifierconf - configurationfactory - socket factoryjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, Client.ConnectionId connId, Configuration conf, javax.net.SocketFactory factory, AlignmentContext alignmentContext) throws java.io.IOException
T - Generics Type Tprotocol - protocol classclientVersion - client's versionconnId - client connection identifierconf - configurationfactory - socket factoryalignmentContext - StateID alignment contextjava.io.IOException - if the far end through a RemoteExceptionpublic static <T> T getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
UserGroupInformation ticket,
Configuration conf,
javax.net.SocketFactory factory,
int rpcTimeout)
throws java.io.IOException
T - Generics Type T.protocol - protocolclientVersion - client's versionaddr - server addressticket - security ticketconf - configurationfactory - socket factoryrpcTimeout - max time for each rpc; 0 means no timeoutjava.io.IOException - if any error occurspublic static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, javax.net.SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy) throws java.io.IOException
T - Generics Type T.protocol - protocolclientVersion - client's versionaddr - server addressticket - security ticketconf - configurationfactory - socket factoryrpcTimeout - max time for each rpc; 0 means no timeoutconnectionRetryPolicy - retry policyjava.io.IOException - if any error occurspublic static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, javax.net.SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth) throws java.io.IOException
T - Generics Type T.protocol - protocolclientVersion - client's versionaddr - server addressticket - security ticketconf - configurationfactory - socket factoryrpcTimeout - max time for each rpc; 0 means no timeoutconnectionRetryPolicy - retry policyfallbackToSimpleAuth - set to true or false during calls to indicate if
a secure client falls back to simple authjava.io.IOException - if any error occurspublic static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, UserGroupInformation ticket, Configuration conf, javax.net.SocketFactory factory, int rpcTimeout, RetryPolicy connectionRetryPolicy, java.util.concurrent.atomic.AtomicBoolean fallbackToSimpleAuth, AlignmentContext alignmentContext) throws java.io.IOException
T - Generics Type T.protocol - protocolclientVersion - client's versionaddr - server addressticket - security ticketconf - configurationfactory - socket factoryrpcTimeout - max time for each rpc; 0 means no timeoutconnectionRetryPolicy - retry policyfallbackToSimpleAuth - set to true or false during calls to indicate
if a secure client falls back to simple authalignmentContext - state alignment contextjava.io.IOException - if any error occurspublic static <T> T getProxy(java.lang.Class<T> protocol,
long clientVersion,
java.net.InetSocketAddress addr,
Configuration conf)
throws java.io.IOException
T - Generics Type T.protocol - input protocol.clientVersion - input clientVersion.addr - input addr.conf - input Configuration.java.io.IOException - if the thread is interrupted.public static java.net.InetSocketAddress getServerAddress(java.lang.Object proxy)
proxy - input proxy.public static Client.ConnectionId getConnectionIdForProxy(java.lang.Object proxy)
proxy - the proxy object to get the connection ID of.public static <T> ProtocolProxy<T> getProtocolProxy(java.lang.Class<T> protocol, long clientVersion, java.net.InetSocketAddress addr, Configuration conf) throws java.io.IOException
T - Generics Type T.protocol - input protocol.clientVersion - input clientVersion.addr - input addr.conf - input configuration.java.io.IOException - if the thread is interrupted.public static void stopProxy(java.lang.Object proxy)
Closeable or must have
associated RpcInvocationHandler.proxy - the RPC proxy object to be stoppedHadoopIllegalArgumentException - if the proxy does not implement Closeable interface or
does not have closeable InvocationHandlerpublic static int getRpcTimeout(Configuration conf)
conf - ConfigurationCopyright © 2008–2025 Apache Software Foundation. All rights reserved.