|
@@ -454,7 +454,7 @@ public class Client {
|
|
|
|
|
|
if (LOG.isDebugEnabled())
|
|
|
LOG.debug("Use " + authMethod + " authentication for protocol "
|
|
|
- + protocol.getSimpleName());
|
|
|
+ + (protocol == null? null: protocol.getSimpleName()));
|
|
|
|
|
|
this.setName("IPC Client (" + socketFactory.hashCode() +") connection to " +
|
|
|
server.toString() +
|
|
@@ -705,7 +705,7 @@ public class Client {
|
|
|
* a header to the server and starts
|
|
|
* the connection thread that waits for responses.
|
|
|
*/
|
|
|
- private synchronized void setupIOstreams() throws InterruptedException {
|
|
|
+ private synchronized void setupIOstreams() {
|
|
|
if (socket != null || shouldCloseConnection.get()) {
|
|
|
return;
|
|
|
}
|
|
@@ -1260,7 +1260,7 @@ public class Client {
|
|
|
* for RPC_BUILTIN
|
|
|
*/
|
|
|
public Writable call(Writable param, InetSocketAddress address)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ throws IOException {
|
|
|
return call(RPC.RpcKind.RPC_BUILTIN, param, address);
|
|
|
|
|
|
}
|
|
@@ -1272,7 +1272,7 @@ public class Client {
|
|
|
*/
|
|
|
@Deprecated
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress address)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ throws IOException {
|
|
|
return call(rpcKind, param, address, null);
|
|
|
}
|
|
|
|
|
@@ -1286,8 +1286,7 @@ public class Client {
|
|
|
*/
|
|
|
@Deprecated
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr,
|
|
|
- UserGroupInformation ticket)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ UserGroupInformation ticket) throws IOException {
|
|
|
ConnectionId remoteId = ConnectionId.getConnectionId(addr, null, ticket, 0,
|
|
|
conf);
|
|
|
return call(rpcKind, param, remoteId);
|
|
@@ -1305,8 +1304,7 @@ public class Client {
|
|
|
@Deprecated
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr,
|
|
|
Class<?> protocol, UserGroupInformation ticket,
|
|
|
- int rpcTimeout)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ int rpcTimeout) throws IOException {
|
|
|
ConnectionId remoteId = ConnectionId.getConnectionId(addr, protocol,
|
|
|
ticket, rpcTimeout, conf);
|
|
|
return call(rpcKind, param, remoteId);
|
|
@@ -1320,8 +1318,7 @@ public class Client {
|
|
|
*/
|
|
|
public Writable call(Writable param, InetSocketAddress addr,
|
|
|
Class<?> protocol, UserGroupInformation ticket,
|
|
|
- int rpcTimeout, Configuration conf)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ int rpcTimeout, Configuration conf) throws IOException {
|
|
|
ConnectionId remoteId = ConnectionId.getConnectionId(addr, protocol,
|
|
|
ticket, rpcTimeout, conf);
|
|
|
return call(RPC.RpcKind.RPC_BUILTIN, param, remoteId);
|
|
@@ -1335,7 +1332,7 @@ public class Client {
|
|
|
public Writable call(Writable param, InetSocketAddress addr,
|
|
|
Class<?> protocol, UserGroupInformation ticket,
|
|
|
int rpcTimeout, int serviceClass, Configuration conf)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ throws IOException {
|
|
|
ConnectionId remoteId = ConnectionId.getConnectionId(addr, protocol,
|
|
|
ticket, rpcTimeout, conf);
|
|
|
return call(RPC.RpcKind.RPC_BUILTIN, param, remoteId, serviceClass);
|
|
@@ -1351,8 +1348,7 @@ public class Client {
|
|
|
*/
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable param, InetSocketAddress addr,
|
|
|
Class<?> protocol, UserGroupInformation ticket,
|
|
|
- int rpcTimeout, Configuration conf)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ int rpcTimeout, Configuration conf) throws IOException {
|
|
|
ConnectionId remoteId = ConnectionId.getConnectionId(addr, protocol,
|
|
|
ticket, rpcTimeout, conf);
|
|
|
return call(rpcKind, param, remoteId);
|
|
@@ -1362,8 +1358,8 @@ public class Client {
|
|
|
* Same as {link {@link #call(RPC.RpcKind, Writable, ConnectionId)}
|
|
|
* except the rpcKind is RPC_BUILTIN
|
|
|
*/
|
|
|
- public Writable call(Writable param, ConnectionId remoteId)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ public Writable call(Writable param, ConnectionId remoteId)
|
|
|
+ throws IOException {
|
|
|
return call(RPC.RpcKind.RPC_BUILTIN, param, remoteId);
|
|
|
}
|
|
|
|
|
@@ -1379,7 +1375,7 @@ public class Client {
|
|
|
* threw an exception.
|
|
|
*/
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
|
|
|
- ConnectionId remoteId) throws InterruptedException, IOException {
|
|
|
+ ConnectionId remoteId) throws IOException {
|
|
|
return call(rpcKind, rpcRequest, remoteId, RPC.RPC_SERVICE_CLASS_DEFAULT);
|
|
|
}
|
|
|
|
|
@@ -1396,8 +1392,7 @@ public class Client {
|
|
|
* threw an exception.
|
|
|
*/
|
|
|
public Writable call(RPC.RpcKind rpcKind, Writable rpcRequest,
|
|
|
- ConnectionId remoteId, int serviceClass)
|
|
|
- throws InterruptedException, IOException {
|
|
|
+ ConnectionId remoteId, int serviceClass) throws IOException {
|
|
|
final Call call = createCall(rpcKind, rpcRequest);
|
|
|
Connection connection = getConnection(remoteId, call, serviceClass);
|
|
|
try {
|
|
@@ -1456,8 +1451,7 @@ public class Client {
|
|
|
/** Get a connection from the pool, or create a new one and add it to the
|
|
|
* pool. Connections to a given ConnectionId are reused. */
|
|
|
private Connection getConnection(ConnectionId remoteId,
|
|
|
- Call call, int serviceClass)
|
|
|
- throws IOException, InterruptedException {
|
|
|
+ Call call, int serviceClass) throws IOException {
|
|
|
if (!running.get()) {
|
|
|
// the client is stopped
|
|
|
throw new IOException("The client is stopped");
|