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/03/31 00:47:07 UTC
[incubator-iotdb] branch cluster updated: remove operator type in
request
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
The following commit(s) were added to refs/heads/cluster by this push:
new d009c46 remove operator type in request
d009c46 is described below
commit d009c466ba32faeaf652f59eadaacca8281b6512
Author: lta <li...@163.com>
AuthorDate: Sun Mar 31 08:46:50 2019 +0800
remove operator type in request
---
.../iotdb/cluster/entity/raft/MetadataStateManchine.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/MetadataStateManchine.java b/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/MetadataStateManchine.java
index 4ab4cb1..004aefa 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/MetadataStateManchine.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/entity/raft/MetadataStateManchine.java
@@ -40,6 +40,7 @@ import org.apache.iotdb.db.exception.ProcessorException;
import org.apache.iotdb.db.metadata.MManager;
import org.apache.iotdb.db.qp.executor.OverflowQPExecutor;
import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
+import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.qp.physical.sys.AuthorPlan;
import org.apache.iotdb.db.qp.physical.sys.MetadataPlan;
import org.apache.iotdb.db.writelog.transfer.PhysicalPlanLogTransfer;
@@ -92,13 +93,13 @@ public class MetadataStateManchine extends StateMachineAdapter {
}
try {
assert request != null;
- if (request.getRequestType() == OperatorType.SET_STORAGE_GROUP) {
- MetadataPlan plan = (MetadataPlan) PhysicalPlanLogTransfer
- .logToOperator(request.getPhysicalPlanBytes());
+ PhysicalPlan physicalPlan = PhysicalPlanLogTransfer
+ .logToOperator(request.getPhysicalPlanBytes());
+ if (physicalPlan.getOperatorType() == OperatorType.SET_STORAGE_GROUP) {
+ MetadataPlan plan = (MetadataPlan) physicalPlan;
addStorageGroup(plan.getPath().getFullPath());
} else {
- AuthorPlan plan = (AuthorPlan) PhysicalPlanLogTransfer
- .logToOperator(request.getPhysicalPlanBytes());
+ AuthorPlan plan = (AuthorPlan) physicalPlan;
qpExecutor.processNonQuery(plan);
}
} catch (IOException | PathErrorException e) {