|
|
@ -39,9 +39,9 @@ public class RpcFuture implements Future<Object> { |
|
|
|
|
|
|
|
|
|
|
|
private long requestId; |
|
|
|
private long requestId; |
|
|
|
|
|
|
|
|
|
|
|
public RpcFuture(RpcRequest rpcRequest,long requestId) { |
|
|
|
public RpcFuture(RpcRequest rpcRequest, long requestId) { |
|
|
|
this.request = rpcRequest; |
|
|
|
this.request = rpcRequest; |
|
|
|
this.requestId=requestId; |
|
|
|
this.requestId = requestId; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -71,7 +71,7 @@ public class RpcFuture implements Future<Object> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public RpcResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { |
|
|
|
public RpcResponse get(long timeout, TimeUnit unit) throws InterruptedException { |
|
|
|
boolean success = latch.await(timeout, unit); |
|
|
|
boolean success = latch.await(timeout, unit); |
|
|
|
if (!success) { |
|
|
|
if (!success) { |
|
|
|
throw new RuntimeException("Timeout exception. Request id: " + requestId |
|
|
|
throw new RuntimeException("Timeout exception. Request id: " + requestId |
|
|
|