code style
parent
4578079368
commit
d3a1da47a7
|
|
@ -72,6 +72,7 @@ public class ConsumerInterceptor {
|
|||
rsp = nettyClient.sendMsg(host, protocol, async);
|
||||
} catch (InterruptedException e) {
|
||||
logger.warn("send msg error ", e);
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
//success
|
||||
if (null != rsp && rsp.getStatus() == 0) {
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ public class RpcFuture implements Future<Object> {
|
|||
|
||||
private long requestId;
|
||||
|
||||
public RpcFuture(RpcRequest rpcRequest,long requestId) {
|
||||
public RpcFuture(RpcRequest rpcRequest, long requestId) {
|
||||
this.request = rpcRequest;
|
||||
this.requestId=requestId;
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -71,9 +71,9 @@ public class RpcFuture implements Future<Object> {
|
|||
}
|
||||
|
||||
@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);
|
||||
if (!success) {
|
||||
if (!success) {
|
||||
throw new RuntimeException("Timeout exception. Request id: " + requestId
|
||||
+ ". Request class name: " + this.request.getClassName()
|
||||
+ ". Request method: " + this.request.getMethodName());
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ import org.apache.dolphinscheduler.rpc.remote.NettyServer;
|
|||
public class Server {
|
||||
|
||||
public static void main(String[] args) {
|
||||
NettyServer nettyServer=new NettyServer(new NettyServerConfig());
|
||||
NettyServer nettyServer = new NettyServer(new NettyServerConfig());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue