Browse Source

code style

pull/3/MERGE
CalvinKirs 3 years ago
parent
commit
3ba03213fe
  1. 3
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java
  2. 2
      dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/UserService.java

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

@ -21,10 +21,8 @@ import org.apache.dolphinscheduler.rpc.common.RpcRequest;
import org.apache.dolphinscheduler.rpc.common.RpcResponse;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* RpcFuture
@ -61,6 +59,7 @@ public class RpcFuture implements Future<Object> {
@Override
public RpcResponse get() throws InterruptedException {
// the timeout period should be defined by the business party
boolean success = latch.await(5, TimeUnit.SECONDS);
if (!success) {
throw new RuntimeException("Timeout exception. Request id: " + this.requestId

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

@ -33,7 +33,7 @@ public class UserService implements IUserService {
@Override
public Integer hi(int num) {
System.out.println("hihihihi+"+num);
System.out.println("hihihihi+" + num);
return ++num;
}
}

Loading…
Cancel
Save