Cpaulyz commented on code in PR #11661:
URL: https://github.com/apache/iotdb/pull/11661#discussion_r1417008745


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/mnode/impl/MeasurementMNode.java:
##########
@@ -33,7 +33,7 @@ public class MeasurementMNode extends 
AbstractMeasurementMNode<IMemMNode, BasicM
   public MeasurementMNode(
       IDeviceMNode<IMemMNode> parent, String name, IMeasurementSchema schema, 
String alias) {
     super(
-        new BasicMNode(parent == null ? null : parent.getAsMNode(), name),
+        new BasicInternalMNode(parent == null ? null : parent.getAsMNode(), 
name),

Review Comment:
   the same



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/mnode/impl/CachedBasicInternalMNode.java:
##########
@@ -181,11 +164,31 @@ public void setChildren(IMNodeContainer<ICachedMNode> 
children) {
    */
   @Override
   public int estimateSize() {
-    return 8 + 80 + 192 + super.estimateSize();
+    return 8
+        + 80
+        + 192
+        + super.estimateSize()
+        + 8
+        + (deviceInfo == null ? 0 : deviceInfo.estimateSize());
+  }
+
+  @Override
+  public MNodeType getMNodeType(Boolean isConfig) {

Review Comment:
   It seems that `isConfig` is unnecessary beacuse only ConfigXXMNode will be 
used in ConfigNode.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/mnode/impl/CachedMeasurementMNode.java:
##########
@@ -34,7 +34,7 @@ public class CachedMeasurementMNode extends 
AbstractMeasurementMNode<ICachedMNod
   public CachedMeasurementMNode(
       IDeviceMNode<ICachedMNode> parent, String name, IMeasurementSchema 
schema, String alias) {
     super(
-        new CachedBasicMNode(parent == null ? null : parent.getAsMNode(), 
name),
+        new CachedBasicInternalMNode(parent == null ? null : 
parent.getAsMNode(), name),

Review Comment:
   why? There are two useless member variables in InternalMNode.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/mnode/impl/CachedBasicInternalMNode.java:
##########
@@ -181,11 +164,31 @@ public void setChildren(IMNodeContainer<ICachedMNode> 
children) {
    */
   @Override
   public int estimateSize() {
-    return 8 + 80 + 192 + super.estimateSize();
+    return 8
+        + 80
+        + 192
+        + super.estimateSize()
+        + 8
+        + (deviceInfo == null ? 0 : deviceInfo.estimateSize());

Review Comment:
   Add javadoc



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to