You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by zy...@apache.org on 2023/04/09 12:26:57 UTC
[iotdb] branch rel/1.1 updated: [To rel/1.1] Rename cluster_schema_limit_level parameter name to timeseries (#9563)
This is an automated email from the ASF dual-hosted git repository.
zyk pushed a commit to branch rel/1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.1 by this push:
new d49f819a2b [To rel/1.1] Rename cluster_schema_limit_level parameter name to timeseries (#9563)
d49f819a2b is described below
commit d49f819a2bcab14c66c99c31229f015628e07586
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Sun Apr 9 20:26:51 2023 +0800
[To rel/1.1] Rename cluster_schema_limit_level parameter name to timeseries (#9563)
---
.../apache/iotdb/db/it/schema/IoTDBClusterDeviceQuotaIT.java | 2 +-
.../iotdb/db/it/schema/IoTDBClusterMeasurementQuotaIT.java | 2 +-
.../src/assembly/resources/conf/iotdb-common.properties | 10 +++++-----
.../apache/iotdb/commons/schema/ClusterSchemaQuotaLevel.java | 2 +-
server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java | 2 +-
.../iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java | 4 ++--
.../apache/iotdb/db/metadata/schemaregion/SchemaEngine.java | 2 +-
7 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterDeviceQuotaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterDeviceQuotaIT.java
index 55e9767f23..477b05806a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterDeviceQuotaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterDeviceQuotaIT.java
@@ -27,7 +27,7 @@ public class IoTDBClusterDeviceQuotaIT extends IoTDBClusterMeasurementQuotaIT {
@Override
protected void setUpQuotaConfig() {
- EnvFactory.getEnv().getConfig().getCommonConfig().setClusterSchemaLimitLevel("DEVICE");
+ EnvFactory.getEnv().getConfig().getCommonConfig().setClusterSchemaLimitLevel("device");
EnvFactory.getEnv().getConfig().getCommonConfig().setClusterMaxSchemaCount(3);
}
}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterMeasurementQuotaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterMeasurementQuotaIT.java
index 4481dedc1d..e6318bdbd2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterMeasurementQuotaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBClusterMeasurementQuotaIT.java
@@ -44,7 +44,7 @@ public class IoTDBClusterMeasurementQuotaIT extends AbstractSchemaIT {
}
protected void setUpQuotaConfig() {
- EnvFactory.getEnv().getConfig().getCommonConfig().setClusterSchemaLimitLevel("MEASUREMENT");
+ EnvFactory.getEnv().getConfig().getCommonConfig().setClusterSchemaLimitLevel("timeseries");
EnvFactory.getEnv().getConfig().getCommonConfig().setClusterMaxSchemaCount(6);
}
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 9f6fc4c526..4d609eeb77 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -289,11 +289,11 @@ cluster_name=defaultCluster
# max_measurement_num_of_internal_request=10000
# This configuration parameter sets the level at which the time series limit is applied.
-# There are two available levels: 'DEVICE' and 'MEASUREMENT'.
-# 'DEVICE': The limit is applied to the number of devices in the cluster.
-# 'MEASUREMENT': The limit is applied to the number of measurements in the cluster.
-# Set the value to either 'device' or 'measurement' based on your desired control level.
-# cluster_schema_limit_level=MEASUREMENT
+# There are two available levels: 'device' and 'timeseries'.
+# 'device': The limit is applied to the number of devices in the cluster.
+# 'timeseries': The limit is applied to the number of timeseries in the cluster.
+# Set the value to either 'device' or 'timeseries' based on your desired control level.
+# cluster_schema_limit_level=timeseries
# This configuration parameter sets the maximum number of schema allowed in the cluster.
# The value should be a positive integer representing the desired threshold.
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/schema/ClusterSchemaQuotaLevel.java b/node-commons/src/main/java/org/apache/iotdb/commons/schema/ClusterSchemaQuotaLevel.java
index 1410f1a1c3..996b08ebfb 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/schema/ClusterSchemaQuotaLevel.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/schema/ClusterSchemaQuotaLevel.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.commons.schema;
public enum ClusterSchemaQuotaLevel {
- MEASUREMENT(0),
+ TIMESERIES(0),
DEVICE(1);
private final int code;
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 35baad5505..4e0f051641 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -1037,7 +1037,7 @@ public class IoTDBConfig {
private boolean enableAuditLog = false;
/** This configuration parameter sets the level at which the time series limit is applied.* */
- private String clusterSchemaLimitLevel = "MEASUREMENT";
+ private String clusterSchemaLimitLevel = "timeseries";
/** This configuration parameter sets the maximum number of schema allowed in the cluster.* */
private long clusterMaxSchemaCount = -1;
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java
index 936cf8c5f6..5aba66223b 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/DataNodeSchemaQuotaManager.java
@@ -40,7 +40,7 @@ public class DataNodeSchemaQuotaManager {
}
public void checkMeasurementLevel(int acquireNumber) throws SchemaQuotaExceededException {
- if (limit > 0 && level.equals(ClusterSchemaQuotaLevel.MEASUREMENT)) {
+ if (limit > 0 && level.equals(ClusterSchemaQuotaLevel.TIMESERIES)) {
if (remain.get() <= 0) {
throw new SchemaQuotaExceededException(level, limit);
} else {
@@ -62,7 +62,7 @@ public class DataNodeSchemaQuotaManager {
public void updateConfiguration() {
this.level =
ClusterSchemaQuotaLevel.valueOf(
- IoTDBDescriptor.getInstance().getConfig().getClusterSchemaLimitLevel());
+ IoTDBDescriptor.getInstance().getConfig().getClusterSchemaLimitLevel().toUpperCase());
long oldLimit = limit;
this.limit = IoTDBDescriptor.getInstance().getConfig().getClusterMaxSchemaCount();
this.remain.addAndGet(limit - oldLimit);
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
index e1b56aa4cf..bec548ef56 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaEngine.java
@@ -365,7 +365,7 @@ public class SchemaEngine {
}
Map<TConsensusGroupId, Long> res = new HashMap<>();
switch (schemaQuotaManager.getLevel()) {
- case MEASUREMENT:
+ case TIMESERIES:
schemaRegionMap.values().stream()
.filter(i -> SchemaRegionConsensusImpl.getInstance().isLeader(i.getSchemaRegionId()))
.forEach(