This is an automated email from the ASF dual-hosted git repository.
zyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new ab9189c22b Eliminate useless isDefaultSchemaMemoryConfig (#9008)
ab9189c22b is described below
commit ab9189c22b02e4edcbe73aa3dfe32c5f8899ad50
Author: Marcos_Zyk <[email protected]>
AuthorDate: Tue Feb 7 22:08:29 2023 +0800
Eliminate useless isDefaultSchemaMemoryConfig (#9008)
---
.../resources/conf/iotdb-common.properties | 1 -
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 14 -------
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 43 ++--------------------
.../java/org/apache/iotdb/db/service/DataNode.java | 1 -
4 files changed, 3 insertions(+), 56 deletions(-)
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties
b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 6d0ab7964b..e3949fa96b 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -188,7 +188,6 @@ cluster_name=defaultCluster
# Schema Memory Allocation Ratio: SchemaRegion, SchemaCache, PartitionCache
and LastCache.
# The parameter form is a:b:c:d, where a, b, c and d are integers. for
example: 1:1:1:1 , 6:2:1:1
-# In cluster mode, we recommend 5:3:1:1. In standalone mode, we recommend
8:1:0:1
# schema_memory_allocate_proportion=5:3:1:1
# Memory allocation ratio in StorageEngine: Write, Compaction
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 0f28f2fc89..4534fc7968 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
@@ -956,12 +956,6 @@ public class IoTDBConfig {
/** ThreadPool size for write operation in coordinator */
private int coordinatorWriteExecutorSize = 50;
- /**
- * Whether the schema memory allocation is default config. Used for cluster
mode initialization
- * judgement
- */
- private boolean isDefaultSchemaMemoryConfig = true;
-
/** Memory allocated for schemaRegion */
private long allocateMemoryForSchemaRegion = allocateMemoryForSchema * 8 /
10;
@@ -3150,14 +3144,6 @@ public class IoTDBConfig {
return new TEndPoint(rpcAddress, rpcPort);
}
- boolean isDefaultSchemaMemoryConfig() {
- return isDefaultSchemaMemoryConfig;
- }
-
- void setDefaultSchemaMemoryConfig(boolean defaultSchemaMemoryConfig) {
- isDefaultSchemaMemoryConfig = defaultSchemaMemoryConfig;
- }
-
public long getAllocateMemoryForSchemaRegion() {
return allocateMemoryForSchemaRegion;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index 128ea8233c..1348f6861a 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -1629,15 +1629,14 @@ public class IoTDBDescriptor {
long schemaMemoryTotal = conf.getAllocateMemoryForSchema();
int proportionSum = 10;
- int schemaRegionProportion = 8;
- int schemaCacheProportion = 1;
- int partitionCacheProportion = 0;
+ int schemaRegionProportion = 5;
+ int schemaCacheProportion = 3;
+ int partitionCacheProportion = 1;
int lastCacheProportion = 1;
String schemaMemoryAllocatePortion =
properties.getProperty("schema_memory_allocate_proportion");
if (schemaMemoryAllocatePortion != null) {
- conf.setDefaultSchemaMemoryConfig(false);
String[] proportions = schemaMemoryAllocatePortion.split(":");
int loadedProportionSum = 0;
for (String proportion : proportions) {
@@ -1651,8 +1650,6 @@ public class IoTDBDescriptor {
partitionCacheProportion = Integer.parseInt(proportions[2].trim());
lastCacheProportion = Integer.parseInt(proportions[3].trim());
}
- } else {
- conf.setDefaultSchemaMemoryConfig(true);
}
conf.setAllocateMemoryForSchemaRegion(
@@ -1933,40 +1930,6 @@ public class IoTDBDescriptor {
SystemInfo.getInstance().allocateWriteMemory();
}
- public void initClusterSchemaMemoryAllocate() {
- if (!conf.isDefaultSchemaMemoryConfig()) {
- // the config has already been updated as user config in properties file
- return;
- }
-
- // process the default schema memory allocate
-
- long schemaMemoryTotal = conf.getAllocateMemoryForSchema();
-
- int proportionSum = 10;
- int schemaRegionProportion = 5;
- int schemaCacheProportion = 3;
- int partitionCacheProportion = 1;
- int lastCacheProportion = 1;
-
- conf.setAllocateMemoryForSchemaRegion(
- schemaMemoryTotal * schemaRegionProportion / proportionSum);
- logger.info(
- "Cluster allocateMemoryForSchemaRegion = {}",
conf.getAllocateMemoryForSchemaRegion());
-
- conf.setAllocateMemoryForSchemaCache(schemaMemoryTotal *
schemaCacheProportion / proportionSum);
- logger.info(
- "Cluster allocateMemoryForSchemaCache = {}",
conf.getAllocateMemoryForSchemaCache());
-
- conf.setAllocateMemoryForPartitionCache(
- schemaMemoryTotal * partitionCacheProportion / proportionSum);
- logger.info(
- "Cluster allocateMemoryForPartitionCache = {}",
conf.getAllocateMemoryForPartitionCache());
-
- conf.setAllocateMemoryForLastCache(schemaMemoryTotal * lastCacheProportion
/ proportionSum);
- logger.info("Cluster allocateMemoryForLastCache = {}",
conf.getAllocateMemoryForLastCache());
- }
-
private static class IoTDBDescriptorHolder {
private static final IoTDBDescriptor INSTANCE = new IoTDBDescriptor();
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 21c96b6915..4699ce0f7e 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -287,7 +287,6 @@ public class DataNode implements DataNodeMBean {
IoTDBStartCheck.getInstance().checkSystemConfig();
IoTDBStartCheck.getInstance().checkDirectory();
IoTDBStartCheck.getInstance().serializeGlobalConfig(configurationResp.globalConfig);
- IoTDBDescriptor.getInstance().initClusterSchemaMemoryAllocate();
if
(!config.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.IOT_CONSENSUS))
{
// In current implementation, only IoTConsensus need separated memory
from Consensus
IoTDBDescriptor.getInstance().reclaimConsensusMemory();