You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2022/05/27 09:30:49 UTC

[iotdb] branch jira3240 created (now ee721b8a42)

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

tanxinyu pushed a change to branch jira3240
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at ee721b8a42 fix consensus layer init too early

This branch includes the following new commits:

     new ee721b8a42 fix consensus layer init too early

The 1 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.



[iotdb] 01/01: fix consensus layer init too early

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

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

commit ee721b8a4281651ca982060f5b40a2434716f8a4
Author: LebronAl <TX...@gmail.com>
AuthorDate: Fri May 27 17:30:39 2022 +0800

    fix consensus layer init too early
---
 .../apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java  | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java
index 7590b1661b..62157d6ecb 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java
@@ -34,7 +34,6 @@ import org.apache.iotdb.commons.exception.MetadataException;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.udf.service.UDFExecutableManager;
 import org.apache.iotdb.commons.udf.service.UDFRegistrationService;
-import org.apache.iotdb.consensus.IConsensus;
 import org.apache.iotdb.consensus.common.Peer;
 import org.apache.iotdb.consensus.common.request.ByteBufferConsensusRequest;
 import org.apache.iotdb.consensus.common.response.ConsensusGenericResponse;
@@ -105,7 +104,6 @@ public class InternalServiceImpl implements InternalService.Iface {
   private static final Logger LOGGER = LoggerFactory.getLogger(InternalServiceImpl.class);
   private final SchemaEngine schemaEngine = SchemaEngine.getInstance();
   private final StorageEngineV2 storageEngine = StorageEngineV2.getInstance();
-  private final IConsensus consensusImpl = ConsensusImpl.getInstance();
   private final double loadBalanceThreshold = 0.1;
 
   public InternalServiceImpl() {
@@ -203,7 +201,7 @@ public class InternalServiceImpl implements InternalService.Iface {
         peers.add(new Peer(schemaRegionId, endpoint));
       }
       ConsensusGenericResponse consensusGenericResponse =
-          consensusImpl.addConsensusGroup(schemaRegionId, peers);
+          ConsensusImpl.getInstance().addConsensusGroup(schemaRegionId, peers);
       if (consensusGenericResponse.isSuccess()) {
         tsStatus = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
       } else {
@@ -241,7 +239,7 @@ public class InternalServiceImpl implements InternalService.Iface {
         peers.add(new Peer(dataRegionId, endpoint));
       }
       ConsensusGenericResponse consensusGenericResponse =
-          consensusImpl.addConsensusGroup(dataRegionId, peers);
+          ConsensusImpl.getInstance().addConsensusGroup(dataRegionId, peers);
       if (consensusGenericResponse.isSuccess()) {
         tsStatus = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
       } else {
@@ -353,7 +351,7 @@ public class InternalServiceImpl implements InternalService.Iface {
     PlanFragment planFragment = new PlanFragment(planFragmentId, deleteRegionNode);
     FragmentInstance fragmentInstance =
         new FragmentInstance(planFragment, fragmentInstanceId, null, QueryType.WRITE);
-    return consensusImpl.write(consensusGroupId, fragmentInstance).getStatus();
+    return ConsensusImpl.getInstance().write(consensusGroupId, fragmentInstance).getStatus();
   }
 
   @Override