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 2019/03/27 09:52:31 UTC

[GitHub] [incubator-iotdb] MyXOF commented on a change in pull request #114: add check SG for MManager, MGraph and MTree

MyXOF commented on a change in pull request #114: add check SG for MManager, MGraph and MTree
URL: https://github.com/apache/incubator-iotdb/pull/114#discussion_r269478041
 
 

 ##########
 File path: iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
 ##########
 @@ -212,6 +212,34 @@ public void setStorageGroup(String path) throws PathErrorException {
     setDataFileName(path, cur);
   }
 
+  /**
+   * check whether the input path is storage group or not
+   * @param path input path
+   * @return if it is storage group, return true. Else return false
+   */
+  public boolean checkStorageGroup(String path) {
+    String[] nodeNames = path.split(DOUB_SEPARATOR);
+    MNode cur = root;
+    if (nodeNames.length <= 1 || !nodeNames[0].equals(root.getName())) {
+      return false;
+    }
+    int i = 1;
+    while (i < nodeNames.length - 1) {
+      MNode temp = cur.getChild(nodeNames[i]);
+      if (temp == null && temp.isStorageLevel()) {
 
 Review comment:
   if temp is null how to invoke isStorageLevel() function?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services