You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by lt...@apache.org on 2019/05/25 04:43:59 UTC

[incubator-iotdb] branch cluster updated (7394372 -> 8cb0bb5)

This is an automated email from the ASF dual-hosted git repository.

lta pushed a change to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


    from 7394372  reformat code
     new 9b152fb  modify test log from info to error
     new 8cb0bb5  modify for raft node as client

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../rpc/raft/impl/RaftNodeAsClientManager.java     | 57 +++++++++++++---------
 cluster/src/test/resources/logback.xml             |  2 +-
 2 files changed, 35 insertions(+), 24 deletions(-)


[incubator-iotdb] 01/02: modify test log from info to error

Posted by lt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lta pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 9b152fb1031607242517f5e081debf6804f0a70e
Author: lta <li...@163.com>
AuthorDate: Thu May 23 17:41:06 2019 +0800

    modify test log from info to error
---
 cluster/src/test/resources/logback.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cluster/src/test/resources/logback.xml b/cluster/src/test/resources/logback.xml
index 58cdf77..a5a2874 100644
--- a/cluster/src/test/resources/logback.xml
+++ b/cluster/src/test/resources/logback.xml
@@ -35,7 +35,7 @@
     </appender>
     <!--<logger name="org.apache.iotdb.db.utils.OpenFileNumUtil" level="debug" />-->
     <!--<logger name="org.apache.iotdb.db.utils.OpenFileNumUtilTest" level="debug" />-->
-    <root level="INFO">
+    <root level="error">
         <appender-ref ref="stdout"/>
     </root>
 </configuration>


[incubator-iotdb] 02/02: modify for raft node as client

Posted by lt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lta pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 8cb0bb5c7d5e1a7733e5e877d6d882a5fdd11b8b
Author: lta <li...@163.com>
AuthorDate: Sat May 25 12:43:46 2019 +0800

    modify for raft node as client
---
 .../rpc/raft/impl/RaftNodeAsClientManager.java     | 57 +++++++++++++---------
 1 file changed, 34 insertions(+), 23 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/rpc/raft/impl/RaftNodeAsClientManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/rpc/raft/impl/RaftNodeAsClientManager.java
index f7de451..d19ea88 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/rpc/raft/impl/RaftNodeAsClientManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/rpc/raft/impl/RaftNodeAsClientManager.java
@@ -216,31 +216,42 @@ public class RaftNodeAsClientManager {
 
     @Override
     public void asyncHandleRequest(SingleQPTask qpTask) {
+//      LOGGER.debug("Node as client to send request to leader: {}", qpTask.getTargetNode());
+//      try {
+//        boltClientService.getRpcClient()
+//            .invokeWithCallback(qpTask.getTargetNode().getEndpoint().toString(),
+//                qpTask.getRequest(),
+//                new InvokeCallback() {
+//
+//                  @Override
+//                  public void onResponse(Object result) {
+//                    BasicResponse response = (BasicResponse) result;
+//                    qpTask.receive(response);
+//                  }
+//
+//                  @Override
+//                  public void onException(Throwable e) {
+//                    LOGGER.error("Bolt rpc client occurs errors when handling Request", e);
+//                    qpTask.setTaskState(TaskState.EXCEPTION);
+//                    qpTask.receive(null);
+//                  }
+//
+//                  @Override
+//                  public Executor getExecutor() {
+//                    return null;
+//                  }
+//                }, TASK_TIMEOUT_MS);
+//      } catch (RemotingException | InterruptedException e) {
+//        LOGGER.error(e.getMessage());
+//        qpTask.setTaskState(TaskState.RAFT_CONNECTION_EXCEPTION);
+//        qpTask.receive(null);
+//      }
       LOGGER.debug("Node as client to send request to leader: {}", qpTask.getTargetNode());
       try {
-        boltClientService.getRpcClient()
-            .invokeWithCallback(qpTask.getTargetNode().getEndpoint().toString(),
-                qpTask.getRequest(),
-                new InvokeCallback() {
-
-                  @Override
-                  public void onResponse(Object result) {
-                    BasicResponse response = (BasicResponse) result;
-                    qpTask.receive(response);
-                  }
-
-                  @Override
-                  public void onException(Throwable e) {
-                    LOGGER.error("Bolt rpc client occurs errors when handling Request", e);
-                    qpTask.setTaskState(TaskState.EXCEPTION);
-                    qpTask.receive(null);
-                  }
-
-                  @Override
-                  public Executor getExecutor() {
-                    return null;
-                  }
-                }, TASK_TIMEOUT_MS);
+        BasicResponse response = (BasicResponse) boltClientService.getRpcClient()
+            .invokeSync(qpTask.getTargetNode().getEndpoint().toString(),
+                qpTask.getRequest(), TASK_TIMEOUT_MS);
+        qpTask.receive(response);
       } catch (RemotingException | InterruptedException e) {
         LOGGER.error(e.getMessage());
         qpTask.setTaskState(TaskState.RAFT_CONNECTION_EXCEPTION);