This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch performance-tuning-2.7.x
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/performance-tuning-2.7.x by
this push:
new b2dbc5e DefaultFuture (#4257)
b2dbc5e is described below
commit b2dbc5ef5da92e3ee5eba06d64a8e00446dd65c7
Author: ken.lj
AuthorDate: Wed Jun 5 18:41:40 2019 +0800
DefaultFuture (#4257)
---
.../dubbo/demo/provider/DemoServiceImpl.java | 10 --
.../apache/dubbo/registry/dubbo/MockChannel.java | 8 ++---
.../apache/dubbo/registry/dubbo/MockedClient.java | 14 -
.../dubbo/remoting/exchange/ExchangeChannel.java | 8 ++---
.../remoting/exchange/support/DefaultFuture.java | 36 +-
.../support/header/HeaderExchangeChannel.java | 18 +--
.../support/header/HeaderExchangeClient.java | 20 ++--
.../test/java/org/apache/dubbo/remoting/Main.java | 10 +++---
.../dubbo/remoting/PerformanceClientFixedTest.java | 5 ++-
.../dubbo/remoting/PerformanceClientTest.java | 9 --
.../exchange/support/DefaultFutureTest.java| 9 --
.../support/header/HeaderExchangeChannelTest.java | 9 +++---
.../transport/mina/ClientToServerTest.java | 2 +-
.../transport/netty/ClientToServerTest.java| 2 +-
.../transport/netty4/ClientToServerTest.java | 2 +-
.../rpc/protocol/dubbo/ChannelWrappedInvoker.java | 11 +--
.../dubbo/rpc/protocol/dubbo/DubboInvoker.java | 4 +--
.../protocol/dubbo/LazyConnectExchangeClient.java | 18 +--
.../dubbo/ReferenceCountExchangeClient.java| 16 +-
.../dubbo/rpc/protocol/thrift/ThriftInvoker.java | 4 +--
.../dubbo/rpc/protocol/thrift/ThriftCodecTest.java | 5 +--
21 files changed, 108 insertions(+), 112 deletions(-)
diff --git
a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/src/main/java/org/apache/dubbo/demo/provider/DemoServiceImpl.java
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/src/main/java/org/apache/dubbo/demo/provider/DemoServiceImpl.java
index 5e57f77..bceeae2 100644
---
a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/src/main/java/org/apache/dubbo/demo/provider/DemoServiceImpl.java
+++
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/src/main/java/org/apache/dubbo/demo/provider/DemoServiceImpl.java
@@ -30,22 +30,12 @@ public class DemoServiceImpl implements DemoService {
@Override
public String sayHello(String name) {
logger.info("Hello " + name + ", request from consumer: " +
RpcContext.getContext().getRemoteAddress());
-try {
-Thread.sleep(1);
-} catch (InterruptedException e) {
-e.printStackTrace();
-}
return "Hello " + name + ", response from provider: " +
RpcContext.getContext().getLocalAddress();
}
@Override
public CompletableFuture sayHelloAsync(String name) {
CompletableFuture cf = CompletableFuture.supplyAsync(() -> {
-try {
-Thread.sleep(1000);
-} catch (InterruptedException e) {
-e.printStackTrace();
-}
return "async result";
});
return cf;
diff --git
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/MockChannel.java
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/MockChannel.java
index e563da6..9c43359 100644
---
a/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/MockChannel.java
+++
b/dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/MockChannel.java
@@ -86,21 +86,21 @@ public class MockChannel implements ExchangeChannel {
return null;
}
-public CompletableFuture request(Object request) throws
RemotingException {
+public CompletableFuture request(Object request, CompletableFuture
completableFuture) throws RemotingException {
return null;
}
-public CompletableFuture request(Object request, int timeout)
throws RemotingException {
+public CompletableFuture request(Object request, int timeout,
CompletableFuture completableFuture) throws RemotingException {
return null;
}
@Override
-public CompletableFuture request(Object request, ExecutorService
executor) throws RemotingException {
+public CompletableFuture request(Object request, ExecutorService
executor, CompletableFuture completableFuture) throws RemotingException {
return null;
}
@Override
-public CompletableFuture request(Object request, int timeout,
ExecutorService executor) throws RemotingException {
+public CompletableFuture request(Object request, int timeout,
ExecutorService executor, CompletableFuture completableFuture) throws
RemotingException {
return null;
}
diff --git
a/dub