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/31 01:24:46 UTC

[incubator-iotdb] 05/05: update

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 ffc9d8981d4dd4c654c14e44fac2b710749add09
Author: lta <li...@163.com>
AuthorDate: Fri May 31 09:24:20 2019 +0800

    update
---
 .../iotdb/cluster/entity/raft/RaftService.java     |  4 +--
 .../rpc/raft/impl/RaftNodeAsClientManager.java     | 30 ----------------------
 2 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftService.java b/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftService.java
index 45d2221..d910f0f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftService.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/RaftService.java
@@ -47,11 +47,11 @@ public class RaftService implements IService {
 
   public RaftService(String groupId, PeerId[] peerIds, PeerId serverId, RpcServer rpcServer, StateMachine fsm, boolean startRpcServer) {
     this.peerIdList = new ArrayList<>(peerIds.length);
-    peerIdList.addAll(Arrays.asList(peerIds));
+    this.peerIdList.addAll(Arrays.asList(peerIds));
     this.fsm = fsm;
     this.groupId = groupId;
     this.startRpcServer = startRpcServer;
-    raftGroupService = new RaftGroupService(groupId, serverId, null, rpcServer);
+    this.raftGroupService = new RaftGroupService(groupId, serverId, null, rpcServer);
   }
 
   @Override
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 d19ea88..088177f 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,36 +216,6 @@ 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 {
         BasicResponse response = (BasicResponse) boltClientService.getRpcClient()