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/09 15:52:40 UTC

[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6199: [IOTDB-3399] Reconstruct PartitionTable

qiaojialin commented on code in PR #6199:
URL: https://github.com/apache/iotdb/pull/6199#discussion_r893628383


##########
confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/DeleteStorageGroupProcedure.java:
##########
@@ -93,7 +93,7 @@ protected Flow executeFromState(ConfigNodeProcedureEnv env, DeleteStorageGroupSt
           break;
         case DELETE_CONFIG:
           LOG.info("Delete config info of {}", deleteSgSchema.getName());
-          TSStatus status = env.deleteConfig(deleteSgSchema);
+          TSStatus status = env.deleteConfig(deleteSgSchema.getName());

Review Comment:
   is this still deleteSgSchema?



##########
confignode/src/main/java/org/apache/iotdb/confignode/persistence/ClusterSchemaInfo.java:
##########
@@ -115,17 +103,11 @@ public TSStatus setStorageGroup(SetStorageGroupReq req) {
           .getStorageGroupNodeByStorageGroupPath(partialPathName)
           .setStorageGroupSchema(storageGroupSchema);
 
-      // Mark the new StorageGroup as without Region
-      schemaRegionParticles.add(storageGroupSchema.getName());
-      dataRegionParticles.add(storageGroupSchema.getName());
-
       result.setCode(TSStatusCode.SUCCESS_STATUS.getStatusCode());
-
-      LOGGER.info("Successfully set StorageGroup: {}", storageGroupSchema);
     } catch (MetadataException e) {
       LOGGER.error("Error StorageGroup name", e);
       result
-          .setCode(TSStatusCode.PERSISTENCE_FAILURE.getStatusCode())
+          .setCode(TSStatusCode.CACHE_FAILURE.getStatusCode())

Review Comment:
   Why SetStorage group failed is a cache failure? It should be set sg failure or schema create failure



##########
confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/RegionInfo.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.confignode.persistence.partition;
+
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
+import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TProtocol;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class RegionInfo {
+
+  private final TConsensusGroupId id;
+  private final TRegionReplicaSet replicaSet;
+
+  private final AtomicLong partitionCount;

Review Comment:
   ```suggestion
     private final AtomicLong slotCount;
   ```
   
   Add javadoc: for DataRegion, each SeriesSlot * TimeSlot form a slot, for SchemaRegion, each SeriesSlot is a slot



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