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/27 04:13:59 UTC

[GitHub] [iotdb] SpriCoder opened a new pull request, #5687: [IOTDB-3019] Feature/show storage group

SpriCoder opened a new pull request, #5687:
URL: https://github.com/apache/iotdb/pull/5687

   See more details: https://issues.apache.org/jira/browse/IOTDB-3019


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


[GitHub] [iotdb] qiaojialin commented on a diff in pull request #5687: [IOTDB-3019] Feature/show storage group

Posted by GitBox <gi...@apache.org>.
qiaojialin commented on code in PR #5687:
URL: https://github.com/apache/iotdb/pull/5687#discussion_r859593506


##########
server/src/main/java/org/apache/iotdb/db/mpp/execution/config/ShowStorageGroupTask.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.mpp.execution.config;
+
+import org.apache.iotdb.commons.conf.IoTDBConstant;
+import org.apache.iotdb.commons.exception.BadNodeUrlException;
+import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchemaResp;
+import org.apache.iotdb.db.client.ConfigNodeClient;
+import org.apache.iotdb.db.conf.IoTDBConfig;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.metadata.MetadataException;
+import org.apache.iotdb.db.localconfignode.LocalConfigNode;
+import org.apache.iotdb.db.metadata.path.PartialPath;
+import org.apache.iotdb.db.mpp.common.header.ColumnHeader;
+import org.apache.iotdb.db.mpp.common.header.DatasetHeader;
+import org.apache.iotdb.db.mpp.sql.statement.metadata.ShowStorageGroupStatement;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.TSStatusCode;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder;
+import org.apache.iotdb.tsfile.utils.Binary;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class ShowStorageGroupTask implements IConfigTask {
+  private static final Logger LOGGER = LoggerFactory.getLogger(ShowStorageGroupTask.class);
+
+  private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
+  private static final TSDataType[] RESOURCE_TYPES = {TSDataType.TEXT};
+
+  private ShowStorageGroupStatement showStorageGroupStatement;
+
+  public ShowStorageGroupTask(ShowStorageGroupStatement showStorageGroupStatement) {
+    this.showStorageGroupStatement = showStorageGroupStatement;
+  }
+
+  @Override
+  public ListenableFuture<ConfigTaskResult> execute() throws InterruptedException {
+    SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+    List<String> storageGroupPaths = new ArrayList<>();
+    if (config.isClusterMode()) {
+      List<String> storageGroupPathPattern =
+          Arrays.asList(showStorageGroupStatement.getPathPattern().getNodes());
+      ConfigNodeClient client = null;
+      try {
+        client = new ConfigNodeClient();

Review Comment:
   need to close this client.
   You can use ClientManager to manage all ConfigNodeClient in datanode



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


[GitHub] [iotdb] qiaojialin merged pull request #5687: [IOTDB-3019] Feature/show storage group

Posted by GitBox <gi...@apache.org>.
qiaojialin merged PR #5687:
URL: https://github.com/apache/iotdb/pull/5687


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