Browse Source

code style

pull/3/MERGE
CalvinKirs 3 years ago
parent
commit
d3a1da47a7
  1. 1
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java
  2. 8
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java
  3. 2
      dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java

1
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java

@ -72,6 +72,7 @@ public class ConsumerInterceptor {
rsp = nettyClient.sendMsg(host, protocol, async); rsp = nettyClient.sendMsg(host, protocol, async);
} catch (InterruptedException e) { } catch (InterruptedException e) {
logger.warn("send msg error ", e); logger.warn("send msg error ", e);
Thread.currentThread().interrupt();
} }
//success //success
if (null != rsp && rsp.getStatus() == 0) { if (null != rsp && rsp.getStatus() == 0) {

8
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java

@ -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,9 +71,9 @@ 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
+ ". Request class name: " + this.request.getClassName() + ". Request class name: " + this.request.getClassName()
+ ". Request method: " + this.request.getMethodName()); + ". Request method: " + this.request.getMethodName());

2
dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java

@ -21,6 +21,6 @@ import org.apache.dolphinscheduler.rpc.remote.NettyServer;
public class Server { public class Server {
public static void main(String[] args) { public static void main(String[] args) {
NettyServer nettyServer=new NettyServer(new NettyServerConfig()); NettyServer nettyServer = new NettyServer(new NettyServerConfig());
} }
} }

Loading…
Cancel
Save