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_r269481324
 
 

 ##########
 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())) {
 
 Review comment:
   I just want to advice that if you use A.equals(B) statement, make sure A is 
not null. since root.getName() is not null, change this order maybe better?

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


With regards,
Apache Git Services

Reply via email to