RYH61 commented on code in PR #9596:
URL: https://github.com/apache/iotdb/pull/9596#discussion_r1172020804


##########
integration-test/src/test/java/org/apache/iotdb/db/it/quotas/IoTDBSpaceQuotaIT.java:
##########
@@ -0,0 +1,492 @@
+/*
+ * 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.it.quotas;
+
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.framework.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(IoTDBTestRunner.class)
+@Category({LocalStandaloneIT.class, ClusterIT.class})
+public class IoTDBSpaceQuotaIT {
+
+  @Before
+  public void setUp() throws Exception {
+    
EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setQuotaEnable(true);
+    EnvFactory.getEnv().initClusterEnvironment();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    
EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setQuotaEnable(false);
+    EnvFactory.getEnv().cleanClusterEnvironment();
+  }
+
+  @Test
+  public void timeseriesNumExceedTest() {
+    try (Connection adminCon = EnvFactory.getEnv().getConnection();
+        Statement adminStmt = adminCon.createStatement()) {
+      adminStmt.execute("set space quota timeseries=3 on root.sg0");
+      adminStmt.execute(
+          "create timeseries root.sg0.wf01.wt01.status0 with 
datatype=BOOLEAN,encoding=PLAIN;");
+      adminStmt.execute(
+          "create timeseries root.sg0.wf01.wt01.status1 with 
datatype=BOOLEAN,encoding=PLAIN;");
+      adminStmt.execute(
+          "create timeseries root.sg0.wf01.wt01.status2 with 
datatype=BOOLEAN,encoding=PLAIN;");
+      Thread.sleep(1000);

Review Comment:
   done



##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/sys/quota/ShowSpaceQuotaTask.java:
##########
@@ -46,6 +46,8 @@
 public class ShowSpaceQuotaTask implements IConfigTask {
 
   private final ShowSpaceQuotaStatement showSpaceQuotaStatement;
+  private static final float unitSize = 1024.0F;
+  private static final String showUnit = "G";
 

Review Comment:
   done



##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterQuotaManager.java:
##########
@@ -59,6 +59,8 @@ public class ClusterQuotaManager {
   private final Map<String, List<Integer>> schemaRegionIdMap;
   private final Map<String, List<Integer>> dataRegionIdMap;
   private final Map<Integer, Long> regionDisk;
+  private static final int UNLIMITED_VALUE = -1;
+  private static final int DEFAULT_VALUE = 0;

Review Comment:
   done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to