You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/03/18 06:52:47 UTC

[GitHub] [iotdb] OneSizeFitsQuorum opened a new pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

OneSizeFitsQuorum opened a new pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277


   - Improve the example of using consensus layer
   - Define `ByteBufferConsensusRequest` to allow the deserialization pushed down into the state machine, which is beneficial to reduce several rounds of forwarding the deserialization overhead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072113480


   
   [![Coverage Status](https://coveralls.io/builds/47483463/badge)](https://coveralls.io/builds/47483463)
   
   Coverage increased (+0.03%) to 65.472% when pulling **57c2b22943d858f449cf180e31002ad5b2b97728 on consensus** into **dc38c7adc183f854eb52010bd09180badc6a708b on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] removed a comment on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072112940






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] OneSizeFitsQuorum commented on a change in pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on a change in pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#discussion_r829827400



##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);

Review comment:
       Fixed

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);
+    return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
   @Override
-  public DataSet read(IConsensusRequest request) {
-    logger.info("Execute read plan : {}", request);
+  public DataSet read(PhysicalPlan plan) {
+    logger.info("Execute read plan in DataRegionStateMachine: {}", plan);

Review comment:
       Fixed

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -17,20 +17,19 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.consensus.ratis;
+package org.apache.iotdb.db.consensus.statemachine;
 
 import org.apache.iotdb.consensus.common.DataSet;
-import org.apache.iotdb.consensus.common.request.IConsensusRequest;
-import org.apache.iotdb.consensus.statemachine.IStateMachine;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class RatisSchemaRegionStateMachine implements IStateMachine {
+public class SchemaRegionStateMachine extends DataRegionStateMachine {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072112940






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072112940


   SonarCloud Quality Gate failed.&nbsp; &nbsp; ![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL)
   
   [![9.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '9.9%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list) [9.9% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list)  
   [![18.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '18.2%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list) [18.2% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin commented on a change in pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#discussion_r829825064



##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);
+    return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
   @Override
-  public DataSet read(IConsensusRequest request) {
-    logger.info("Execute read plan : {}", request);
+  public DataSet read(PhysicalPlan plan) {
+    logger.info("Execute read plan in DataRegionStateMachine: {}", plan);

Review comment:
       ```suggestion
       logger.info("Execute read plan in SchemaRegionStateMachine: {}", plan);
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -17,20 +17,19 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.consensus.ratis;
+package org.apache.iotdb.db.consensus.statemachine;
 
 import org.apache.iotdb.consensus.common.DataSet;
-import org.apache.iotdb.consensus.common.request.IConsensusRequest;
-import org.apache.iotdb.consensus.statemachine.IStateMachine;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class RatisSchemaRegionStateMachine implements IStateMachine {
+public class SchemaRegionStateMachine extends DataRegionStateMachine {

Review comment:
       ```suggestion
   public class SchemaRegionStateMachine extends BaseStateMachine {
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);

Review comment:
       ```suggestion
       logger.info("Execute write plan in SchemaRegionStateMachine : {}", plan);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin commented on a change in pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#discussion_r829825064



##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);
+    return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
   @Override
-  public DataSet read(IConsensusRequest request) {
-    logger.info("Execute read plan : {}", request);
+  public DataSet read(PhysicalPlan plan) {
+    logger.info("Execute read plan in DataRegionStateMachine: {}", plan);

Review comment:
       ```suggestion
       logger.info("Execute read plan in SchemaRegionStateMachine: {}", plan);
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -17,20 +17,19 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.consensus.ratis;
+package org.apache.iotdb.db.consensus.statemachine;
 
 import org.apache.iotdb.consensus.common.DataSet;
-import org.apache.iotdb.consensus.common.request.IConsensusRequest;
-import org.apache.iotdb.consensus.statemachine.IStateMachine;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class RatisSchemaRegionStateMachine implements IStateMachine {
+public class SchemaRegionStateMachine extends DataRegionStateMachine {

Review comment:
       ```suggestion
   public class SchemaRegionStateMachine extends BaseStateMachine {
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);

Review comment:
       ```suggestion
       logger.info("Execute write plan in SchemaRegionStateMachine : {}", plan);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] removed a comment on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072112940


   SonarCloud Quality Gate failed.&nbsp; &nbsp; ![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL)
   
   [![9.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '9.9%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list) [9.9% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list)  
   [![18.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '18.2%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list) [18.2% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin merged pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] qiaojialin merged pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072294747


   SonarCloud Quality Gate failed.&nbsp; &nbsp; ![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL)
   
   [![10.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '10.3%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list) [10.3% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list)  
   [![8.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '8.8%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list) [8.8% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] OneSizeFitsQuorum commented on a change in pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum commented on a change in pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#discussion_r829827400



##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);

Review comment:
       Fixed

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -39,16 +38,14 @@ public void start() {}
   public void stop() {}
 
   @Override
-  public TSStatus write(IConsensusRequest request) {
-    if (request instanceof InsertRowPlan) {
-      logger.info("Execute write plan : {}", request);
-    }
-    return new TSStatus(200);
+  public TSStatus write(PhysicalPlan plan) {
+    logger.info("Execute write plan in DataRegionStateMachine : {}", plan);
+    return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
   @Override
-  public DataSet read(IConsensusRequest request) {
-    logger.info("Execute read plan : {}", request);
+  public DataSet read(PhysicalPlan plan) {
+    logger.info("Execute read plan in DataRegionStateMachine: {}", plan);

Review comment:
       Fixed

##########
File path: server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
##########
@@ -17,20 +17,19 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.consensus.ratis;
+package org.apache.iotdb.db.consensus.statemachine;
 
 import org.apache.iotdb.consensus.common.DataSet;
-import org.apache.iotdb.consensus.common.request.IConsensusRequest;
-import org.apache.iotdb.consensus.statemachine.IStateMachine;
-import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
+import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class RatisSchemaRegionStateMachine implements IStateMachine {
+public class SchemaRegionStateMachine extends DataRegionStateMachine {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072227283


   SonarCloud Quality Gate failed.&nbsp; &nbsp; ![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL)
   
   [![10.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '10.3%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list) [10.3% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list)  
   [![8.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '8.8%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list) [8.8% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] sonarcloud[bot] removed a comment on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072227283


   SonarCloud Quality Gate failed.&nbsp; &nbsp; ![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL) [15 Code Smells](https://sonarcloud.io/project/issues?id=apache_incubator-iotdb&pullRequest=5277&resolved=false&types=CODE_SMELL)
   
   [![10.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '10.3%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list) [10.3% Coverage](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_coverage&view=list)  
   [![8.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '8.8%')](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list) [8.8% Duplication](https://sonarcloud.io/component_measures?id=apache_incubator-iotdb&pullRequest=5277&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls commented on pull request #5277: [IOTDB-2764] Refine the consensus layer framework and add examples

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #5277:
URL: https://github.com/apache/iotdb/pull/5277#issuecomment-1072113480


   
   [![Coverage Status](https://coveralls.io/builds/47483463/badge)](https://coveralls.io/builds/47483463)
   
   Coverage increased (+0.03%) to 65.472% when pulling **57c2b22943d858f449cf180e31002ad5b2b97728 on consensus** into **dc38c7adc183f854eb52010bd09180badc6a708b on master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org