weizihan0110 commented on a change in pull request #2468:
URL: https://github.com/apache/iotdb/pull/2468#discussion_r565326776



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/MNode.java
##########
@@ -250,4 +252,20 @@ void serializeChildren(MLogWriter logWriter) throws 
IOException {
       entry.getValue().serializeTo(logWriter);
     }
   }
+
+  public void replaceChild(String measurement, MNode newChildNode) {
+    MNode child = this.getChild(measurement);
+    if (child == null) {
+      return;
+    }
+    Map<String, MNode> children = child.getChildren();
+    //newChildNode builds parent-child relationship
+    newChildNode.setChildren(children);
+    children.forEach((name, childNode) -> childNode.setParent(newChildNode));

Review comment:
       Thanks. Next time I'll check all of code shell that sonarcloud  reports 
and fix all the reasonable ones.




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

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


Reply via email to