You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ch...@apache.org on 2020/12/25 13:07:28 UTC

[iotdb] branch master updated: refactor the code

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

chaow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new d76076d  refactor the code
     new 095803c  Merge pull request #2339 from neuyilan/apache_master_1225_refactor_the_code
d76076d is described below

commit d76076dc26ab02bc1a8fd772f3e731d76806e694
Author: HouliangQi <ne...@163.com>
AuthorDate: Fri Dec 25 19:29:10 2020 +0800

    refactor the code
---
 .../org/apache/iotdb/cluster/server/service/BaseSyncService.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/BaseSyncService.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/BaseSyncService.java
index 5a07130..e1e118f 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/BaseSyncService.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/BaseSyncService.java
@@ -81,7 +81,7 @@ public abstract class BaseSyncService implements RaftService.Iface {
     try {
       return member.appendEntries(request);
     } catch (BufferUnderflowException e) {
-      logger.error("Underflown buffers {} of logs from {}", request.getEntries(),
+      logger.error("Underflow buffers {} of logs from {}", request.getEntries(),
           request.getPrevLogIndex() + 1);
       throw new TException(e);
     } catch (Exception e) {
@@ -102,16 +102,15 @@ public abstract class BaseSyncService implements RaftService.Iface {
     if (client == null) {
       throw new TException(new LeaderUnknownException(member.getAllNodes()));
     }
-    long commitIndex1 = 0;
     try {
-      commitIndex1 = client.requestCommitIndex(header);
+      commitIndex = client.requestCommitIndex(header);
     } catch (TException e) {
       client.getInputProtocol().getTransport().close();
       throw e;
     } finally {
       putBackSyncClient(client);
     }
-    return commitIndex1;
+    return commitIndex;
   }
 
   void putBackSyncClient(Client client) {