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 2021/07/19 12:23:30 UTC

[GitHub] [iotdb] SilverNarcissus commented on a change in pull request #3589: [IOTDB-1498] MNode Abstraction and Structure Improvement

SilverNarcissus commented on a change in pull request #3589:
URL: https://github.com/apache/iotdb/pull/3589#discussion_r672237092



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java
##########
@@ -67,12 +75,21 @@ public MeasurementMNode(
   }
 
   public MeasurementMNode(
-      MNode parent, String measurementName, IMeasurementSchema schema, String alias) {
+      IMNode parent, String measurementName, IMeasurementSchema schema, String alias) {
     super(parent, measurementName);
     this.schema = schema;
     this.alias = alias;
   }
 
+  @Override
+  public int getMeasurementMNodeCount() {
+    return 1;

Review comment:
       You can use a constant to replace it

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/MeasurementMNode.java
##########
@@ -205,4 +220,88 @@ public TSDataType getDataType(String measurementId) {
       return schema.getValueTSDataTypeList().get(index);
     }
   }
+
+  @Override
+  public boolean hasChild(String name) {
+    return false;
+  }
+
+  @Override
+  public void addChild(String name, IMNode child) {
+    // Do nothing
+  }
+
+  @Override
+  public IMNode addChild(IMNode child) {
+    return null;
+  }
+
+  @Override
+  public void deleteChild(String name) {
+    // Do nothing
+  }
+
+  @Override
+  public void deleteAliasChild(String alias) {
+    // Do nothing
+  }
+
+  @Override
+  public Template getDeviceTemplate() {
+    return null;

Review comment:
       May be throw a exception here and explain we can't get template from a measurement node

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/IMNode.java
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.metadata.mnode;
+
+import org.apache.iotdb.db.exception.metadata.MetadataException;
+import org.apache.iotdb.db.metadata.PartialPath;
+import org.apache.iotdb.db.metadata.logfile.MLogWriter;
+import org.apache.iotdb.db.metadata.template.Template;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Map;
+
+public interface IMNode extends Serializable {

Review comment:
       Maybe you can add some doc to this critical interface




-- 
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