mdf369 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_r269486551
########## 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 see, but only when "nodeNames.length > 1" the memtioned statement will be executed, so nodeNames[0] will not be null as well. The order is same as many implementations in MTree, so it should be fine. ---------------------------------------------------------------- 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