Modifier and Type | Class and Description |
---|---|
static class |
Client.ConnectionId
This class holds the address and the user ticket.
|
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
Client(Class<? extends Writable> valueClass,
Configuration conf)
Construct an IPC client with the default SocketFactory
|
Client(Class<? extends Writable> valueClass,
Configuration conf,
SocketFactory factory)
Construct an IPC client whose values are of the given
Writable
class. |
Modifier and Type | Method and Description |
---|---|
Writable |
call(RPC.RpcKind rpcKind,
Writable rpcRequest,
Client.ConnectionId remoteId)
Make a call, passing
rpcRequest , to the IPC server defined by
remoteId , returning the rpc respond. |
Writable |
call(RPC.RpcKind rpcKind,
Writable rpcRequest,
Client.ConnectionId remoteId,
int serviceClass)
Make a call, passing
rpcRequest , to the IPC server defined by
remoteId , returning the rpc respond. |
Writable |
call(RPC.RpcKind rpcKind,
Writable param,
InetSocketAddress address)
Deprecated.
Use
call(RPC.RpcKind, Writable,
ConnectionId) instead |
Writable |
call(RPC.RpcKind rpcKind,
Writable param,
InetSocketAddress addr,
Class<?> protocol,
UserGroupInformation ticket,
int rpcTimeout)
Deprecated.
Use
call(RPC.RpcKind, Writable,
ConnectionId) instead |
Writable |
call(RPC.RpcKind rpcKind,
Writable param,
InetSocketAddress addr,
Class<?> protocol,
UserGroupInformation ticket,
int rpcTimeout,
Configuration conf)
Make a call, passing
param , to the IPC server running at
address which is servicing the protocol protocol,
with the ticket credentials, rpcTimeout as
timeout and conf as conf for this connection, returning the
value. |
Writable |
call(RPC.RpcKind rpcKind,
Writable param,
InetSocketAddress addr,
UserGroupInformation ticket)
Deprecated.
Use
call(RPC.RpcKind, Writable,
ConnectionId) instead |
Writable |
call(Writable param,
Client.ConnectionId remoteId)
Same as {link
call(RPC.RpcKind, Writable, ConnectionId)
except the rpcKind is RPC_BUILTIN |
Writable |
call(Writable param,
InetSocketAddress address)
Same as
call(RPC.RpcKind, Writable, ConnectionId)
for RPC_BUILTIN |
Writable |
call(Writable param,
InetSocketAddress addr,
Class<?> protocol,
UserGroupInformation ticket,
int rpcTimeout,
Configuration conf)
Same as
call(RPC.RpcKind, Writable, InetSocketAddress,
Class, UserGroupInformation, int, Configuration)
except that rpcKind is writable. |
Writable |
call(Writable param,
InetSocketAddress addr,
Class<?> protocol,
UserGroupInformation ticket,
int rpcTimeout,
int serviceClass,
Configuration conf)
Same as
call(Writable, InetSocketAddress,
Class, UserGroupInformation, int, Configuration)
except that specifying serviceClass. |
static int |
getTimeout(Configuration conf)
The time after which a RPC will timeout.
|
static int |
nextCallId()
Returns the next valid sequential call ID by incrementing an atomic counter
and masking off the sign bit.
|
static void |
setCallIdAndRetryCount(int cid,
int rc)
Set call id and retry count for the next call.
|
static void |
setConnectTimeout(Configuration conf,
int timeout)
set the connection timeout value in configuration
|
static void |
setPingInterval(Configuration conf,
int pingInterval)
set the ping interval value in configuration
|
void |
stop()
Stop all threads related to this client.
|
public Client(Class<? extends Writable> valueClass, Configuration conf, SocketFactory factory)
Writable
class.public Client(Class<? extends Writable> valueClass, Configuration conf)
valueClass
- conf
- public static void setCallIdAndRetryCount(int cid, int rc)
public static final void setPingInterval(Configuration conf, int pingInterval)
conf
- ConfigurationpingInterval
- the ping intervalpublic static final int getTimeout(Configuration conf)
conf
- Configurationpublic static final void setConnectTimeout(Configuration conf, int timeout)
conf
- Configurationtimeout
- the socket connect timeout valuepublic void stop()
public Writable call(Writable param, InetSocketAddress address) throws IOException
call(RPC.RpcKind, Writable, ConnectionId)
for RPC_BUILTINIOException
@Deprecated public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress address) throws IOException
call(RPC.RpcKind, Writable,
ConnectionId)
insteadparam
, to the IPC server running at
address
, returning the value. Throws exceptions if there are
network problems or if the remote code threw an exception.IOException
@Deprecated public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr, UserGroupInformation ticket) throws IOException
call(RPC.RpcKind, Writable,
ConnectionId)
insteadparam
, to the IPC server running at
address
with the ticket
credentials, returning
the value.
Throws exceptions if there are network problems or if the remote code
threw an exception.IOException
@Deprecated public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr, Class<?> protocol, UserGroupInformation ticket, int rpcTimeout) throws IOException
call(RPC.RpcKind, Writable,
ConnectionId)
insteadparam
, to the IPC server running at
address
which is servicing the protocol
protocol,
with the ticket
credentials and rpcTimeout
as
timeout, returning the value.
Throws exceptions if there are network problems or if the remote code
threw an exception.IOException
public Writable call(Writable param, InetSocketAddress addr, Class<?> protocol, UserGroupInformation ticket, int rpcTimeout, Configuration conf) throws IOException
call(RPC.RpcKind, Writable, InetSocketAddress,
Class, UserGroupInformation, int, Configuration)
except that rpcKind is writable.IOException
public Writable call(Writable param, InetSocketAddress addr, Class<?> protocol, UserGroupInformation ticket, int rpcTimeout, int serviceClass, Configuration conf) throws IOException
call(Writable, InetSocketAddress,
Class, UserGroupInformation, int, Configuration)
except that specifying serviceClass.IOException
public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr, Class<?> protocol, UserGroupInformation ticket, int rpcTimeout, Configuration conf) throws IOException
param
, to the IPC server running at
address
which is servicing the protocol
protocol,
with the ticket
credentials, rpcTimeout
as
timeout and conf
as conf for this connection, returning the
value. Throws exceptions if there are network problems or if the remote
code threw an exception.IOException
public Writable call(Writable param, Client.ConnectionId remoteId) throws IOException
call(RPC.RpcKind, Writable, ConnectionId)
except the rpcKind is RPC_BUILTINIOException
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest, Client.ConnectionId remoteId) throws IOException
rpcRequest
, to the IPC server defined by
remoteId
, returning the rpc respond.rpcKind
- rpcRequest
- - contains serialized method and method parametersremoteId
- - the target rpc serverIOException
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest, Client.ConnectionId remoteId, int serviceClass) throws IOException
rpcRequest
, to the IPC server defined by
remoteId
, returning the rpc respond.rpcKind
- rpcRequest
- - contains serialized method and method parametersremoteId
- - the target rpc serverserviceClass
- - service class for RPCIOException
public static int nextCallId()
Copyright © 2013 Apache Software Foundation. All rights reserved.