Skip to content

Commit 5210167

Browse files
committed
implement unchangeable config
1 parent 33aeaee commit 5210167

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ public class ConfigNodeConfig {
316316

317317
private long forceWalPeriodForConfigNodeSimpleInMs = 100;
318318

319+
private boolean restrictObjectLimit = false;
320+
319321
public ConfigNodeConfig() {
320322
// empty constructor
321323
}
@@ -1275,4 +1277,12 @@ public long getFailureDetectorPhiAcceptablePauseInMs() {
12751277
public void setFailureDetectorPhiAcceptablePauseInMs(long failureDetectorPhiAcceptablePauseInMs) {
12761278
this.failureDetectorPhiAcceptablePauseInMs = failureDetectorPhiAcceptablePauseInMs;
12771279
}
1280+
1281+
public boolean getRestrictObjectLimit() {
1282+
return restrictObjectLimit;
1283+
}
1284+
1285+
public void setRestrictObjectLimit(boolean restrictObjectLimit) {
1286+
this.restrictObjectLimit = restrictObjectLimit;
1287+
}
12781288
}

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ public static void checkSystemProperties() throws IOException {
213213
COMMON_CONFIG.setEnableGrantOption(enableGrantOption);
214214
}
215215
}
216+
217+
if (systemProperties.getProperty("restrict_object_limit", null) != null) {
218+
boolean restrictObjectLimit =
219+
Boolean.parseBoolean(systemProperties.getProperty("restrict_object_limit"));
220+
if (restrictObjectLimit != conf.getRestrictObjectLimit()) {
221+
LOGGER.warn(
222+
format, "restrict_object_limit", conf.getRestrictObjectLimit(), restrictObjectLimit);
223+
conf.setRestrictObjectLimit(restrictObjectLimit);
224+
}
225+
}
216226
}
217227

218228
/**
@@ -286,6 +296,8 @@ public static void storeSystemParameters() throws IOException {
286296
"tag_attribute_total_size", String.valueOf(COMMON_CONFIG.getTagAttributeTotalSize()));
287297
systemProperties.setProperty(
288298
"enable_grant_option", String.valueOf(COMMON_CONFIG.getEnableGrantOption()));
299+
systemProperties.setProperty(
300+
"restrict_object_limit", String.valueOf(conf.getRestrictObjectLimit()));
289301
systemPropertiesHandler.overwrite(systemProperties);
290302
}
291303

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ private void setGlobalConfig(ConfigurationResp dataSet) {
179179
globalConfig.setSchemaEngineMode(commonConfig.getSchemaEngineMode());
180180
globalConfig.setTagAttributeTotalSize(commonConfig.getTagAttributeTotalSize());
181181
globalConfig.setEnableGrantOption(commonConfig.getEnableGrantOption());
182+
globalConfig.setRestrictObjectLimit(configNodeConfig.getRestrictObjectLimit());
182183
dataSet.setGlobalConfig(globalConfig);
183184
}
184185

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,7 @@ public void loadGlobalConfig(TGlobalConfig globalConfig) {
27172717
conf.setSeriesPartitionExecutorClass(globalConfig.getSeriesPartitionExecutorClass());
27182718
conf.setSeriesPartitionSlotNum(globalConfig.getSeriesPartitionSlotNum());
27192719
conf.setReadConsistencyLevel(globalConfig.getReadConsistencyLevel());
2720+
conf.setRestrictObjectLimit(globalConfig.isRestrictObjectLimit());
27202721
}
27212722

27222723
public void loadRatisConfig(TRatisConfig ratisConfig) {

iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct TGlobalConfig {
5050
11: optional i32 tagAttributeTotalSize
5151
12: optional bool isEnterprise
5252
13: optional i64 timePartitionOrigin
53+
14: optional bool restrictObjectLimit
5354
}
5455

5556
struct TRatisConfig {

0 commit comments

Comments
 (0)