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/25 06:46:17 UTC

[GitHub] [iotdb] HTHou commented on a diff in pull request #5655: Support set storage group in standalone mpp mode

HTHou commented on code in PR #5655:
URL: https://github.com/apache/iotdb/pull/5655#discussion_r857302905


##########
server/src/main/java/org/apache/iotdb/db/mpp/execution/config/SetStorageGroupTask.java:
##########
@@ -45,31 +48,39 @@ public SetStorageGroupTask(SetStorageGroupStatement setStorageGroupStatement) {
   @Override
   public ListenableFuture<ConfigTaskResult> execute() {
     SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    // Construct request using statement
-    TStorageGroupSchema storageGroupSchema = new TStorageGroupSchema();
-    storageGroupSchema.setName(setStorageGroupStatement.getStorageGroupPath().getFullPath());
-    TSetStorageGroupReq req = new TSetStorageGroupReq(storageGroupSchema);
-
-    ConfigNodeClient configNodeClient = null;
-    try {
-      configNodeClient = new ConfigNodeClient();
-      // Send request to some API server
-      TSStatus tsStatus = configNodeClient.setStorageGroup(req);
-      // Get response or throw exception
-      if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
-        LOGGER.error(
-            "Failed to execute set storage group {} in config node, status is {}.",
-            setStorageGroupStatement.getStorageGroupPath(),
-            tsStatus);
-        future.setException(new StatementExecutionException(tsStatus));
-      } else {
-        future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
+    if (IoTDB.getInstance().isMppClusterMode()) {
+      // Construct request using statement

Review Comment:
   Yes, it is a temporary implementation. We need to fix it in the future. Let me add a TODO mark.



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