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 2022/06/06 02:30:59 UTC

[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #6162: [IOTDB-3259] fix sg already exists check.

MarcosZyk commented on code in PR #6162:
URL: https://github.com/apache/iotdb/pull/6162#discussion_r889782601


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java:
##########
@@ -65,16 +65,16 @@ public ClusterSchemaManager(Manager configManager, ClusterSchemaInfo clusterSche
    */
   public TSStatus setStorageGroup(SetStorageGroupReq setStorageGroupReq) {
     TSStatus result;
-    if (clusterSchemaInfo.containsStorageGroup(setStorageGroupReq.getSchema().getName())) {
+    try {
+      clusterSchemaInfo.checkContainsStorageGroup(setStorageGroupReq.getSchema().getName());
+    } catch (MetadataException metadataException) {
       // Reject if StorageGroup already set

Review Comment:
   Maybe use specific ```StorageGroupAlreadyExistException``` is 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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org