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 09:28:12 UTC

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

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