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/04/12 11:22:05 UTC

[GitHub] [iotdb] SpriCoder commented on a diff in pull request #5486: [IOTDB-2886] refact LocalConfigManager and finish createSchemaRegion

SpriCoder commented on code in PR #5486:
URL: https://github.com/apache/iotdb/pull/5486#discussion_r848320987


##########
server/src/main/java/org/apache/iotdb/db/metadata/LocalConfigNode.java:
##########
@@ -759,23 +717,29 @@ public void dropSchemaTemplate(DropTemplatePlan plan) throws MetadataException {
   public synchronized void setSchemaTemplate(SetTemplatePlan plan) throws MetadataException {
     PartialPath path = new PartialPath(plan.getPrefixPath());
     try {
-      getBelongedSchemaRegionWithAutoCreate(path).setSchemaTemplate(plan);
+      schemaEngine
+          .getSchemaRegion(getBelongedSchemaRegionIdWithAutoCreate(path))
+          .setSchemaTemplate(plan);
     } catch (StorageGroupAlreadySetException e) {
       throw new MetadataException("Template should not be set above storageGroup");
     }
   }
 
   public synchronized void unsetSchemaTemplate(UnsetTemplatePlan plan) throws MetadataException {
+    PartialPath path = new PartialPath(plan.getPrefixPath());
     try {
-      getBelongedSchemaRegion(new PartialPath(plan.getPrefixPath())).unsetSchemaTemplate(plan);
+      schemaEngine
+          .getSchemaRegion(getBelongedSchemaRegionIdWithAutoCreate(path))
+          .unsetSchemaTemplate(plan);

Review Comment:
   Already fixed!



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