This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch force_ci/object_type in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 2078b4f706dc9672537b6993f83b46df5de3329d Author: Caideyipi <[email protected]> AuthorDate: Tue Nov 18 16:02:04 2025 +0800 fix (#16773) (cherry picked from commit bd97844bb7f54c9ecd8f4831a8fd3efc8400d996) --- .../java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java | 10 +++++++--- .../plan/analyze/cache/partition/PartitionCache.java | 2 +- .../metadata/fetcher/cache/TableDeviceSchemaCache.java | 2 +- .../metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java | 9 +++++---- .../db/schemaengine/rescon/MemSchemaEngineStatistics.java | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java index 551d8a9031d..373cec94a66 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java @@ -32,6 +32,10 @@ import org.slf4j.LoggerFactory; public class DataNodeMemoryConfig { private static final Logger LOGGER = LoggerFactory.getLogger(DataNodeMemoryConfig.class); + public static final String SCHEMA_CACHE = "SchemaCache"; + public static final String SCHEMA_REGION = "SchemaRegion"; + public static final String PARTITION_CACHE = "PartitionCache"; + /** Reject proportion for system */ private double rejectProportion = 0.8; @@ -265,13 +269,13 @@ public class DataNodeMemoryConfig { schemaRegionMemoryManager = schemaEngineMemoryManager.getOrCreateMemoryManager( - "SchemaRegion", schemaMemoryTotal * schemaMemoryProportion[0] / proportionSum); + SCHEMA_REGION, schemaMemoryTotal * schemaMemoryProportion[0] / proportionSum); schemaCacheMemoryManager = schemaEngineMemoryManager.getOrCreateMemoryManager( - "SchemaCache", schemaMemoryTotal * schemaMemoryProportion[1] / proportionSum); + SCHEMA_CACHE, schemaMemoryTotal * schemaMemoryProportion[1] / proportionSum); partitionCacheMemoryManager = schemaEngineMemoryManager.getOrCreateMemoryManager( - "PartitionCache", schemaMemoryTotal * schemaMemoryProportion[2] / proportionSum); + PARTITION_CACHE, schemaMemoryTotal * schemaMemoryProportion[2] / proportionSum); LOGGER.info( "allocateMemoryForSchemaRegion = {}", diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java index df379b47896..3c76bd08c1d 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java @@ -128,7 +128,7 @@ public class PartitionCache { this.memoryBlock = memoryConfig .getPartitionCacheMemoryManager() - .exactAllocate("PartitionCache", MemoryBlockType.STATIC); + .exactAllocate(DataNodeMemoryConfig.PARTITION_CACHE, MemoryBlockType.STATIC); this.memoryBlock.allocate(this.memoryBlock.getTotalMemorySizeInBytes()); // TODO @spricoder: PartitionCache need to be controlled according to memory this.schemaPartitionCache = diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java index 90fc4fb0e94..acb9c5e6180 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java @@ -112,7 +112,7 @@ public class TableDeviceSchemaCache { memoryBlock = memoryConfig .getSchemaCacheMemoryManager() - .exactAllocate("TableDeviceSchemaCache", MemoryBlockType.STATIC); + .exactAllocate(DataNodeMemoryConfig.SCHEMA_CACHE, MemoryBlockType.STATIC); dualKeyCache = new DualKeyCacheBuilder<TableId, IDeviceID, TableDeviceCacheEntry>() .cacheEvictionPolicy( diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java index e65c418c0c1..5063150759f 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java @@ -21,6 +21,7 @@ package org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache; import org.apache.iotdb.commons.service.metric.enums.Metric; import org.apache.iotdb.commons.service.metric.enums.Tag; +import org.apache.iotdb.db.conf.DataNodeMemoryConfig; import org.apache.iotdb.metrics.AbstractMetricService; import org.apache.iotdb.metrics.metricsets.IMetricSet; import org.apache.iotdb.metrics.utils.MetricLevel; @@ -47,7 +48,7 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet { tableDeviceSchemaCache, TableDeviceSchemaCache::getHitCount, Tag.NAME.toString(), - "SchemaCache", + DataNodeMemoryConfig.SCHEMA_CACHE, Tag.TYPE.toString(), "hit"); metricService.createAutoGauge( @@ -56,7 +57,7 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet { tableDeviceSchemaCache, TableDeviceSchemaCache::getRequestCount, Tag.NAME.toString(), - "SchemaCache", + DataNodeMemoryConfig.SCHEMA_CACHE, Tag.TYPE.toString(), "all"); metricService.createAutoGauge( @@ -86,14 +87,14 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet { MetricType.AUTO_GAUGE, Metric.CACHE.toString(), Tag.NAME.toString(), - "SchemaCache", + DataNodeMemoryConfig.SCHEMA_CACHE, Tag.TYPE.toString(), "hit"); metricService.remove( MetricType.AUTO_GAUGE, Metric.CACHE.toString(), Tag.NAME.toString(), - "SchemaCache", + DataNodeMemoryConfig.SCHEMA_CACHE, Tag.TYPE.toString(), "all"); metricService.remove( diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java index c50dd62ecea..61de4a1a813 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java @@ -21,6 +21,7 @@ package org.apache.iotdb.db.schemaengine.rescon; import org.apache.iotdb.commons.memory.IMemoryBlock; import org.apache.iotdb.commons.memory.MemoryBlockType; +import org.apache.iotdb.db.conf.DataNodeMemoryConfig; import org.apache.iotdb.db.conf.IoTDBDescriptor; import org.apache.iotdb.db.schemaengine.SchemaEngine; import org.apache.iotdb.db.schemaengine.template.ClusterTemplateManager; @@ -41,7 +42,7 @@ public class MemSchemaEngineStatistics implements ISchemaEngineStatistics { IoTDBDescriptor.getInstance() .getMemoryConfig() .getSchemaRegionMemoryManager() - .exactAllocate("SchemaRegion", MemoryBlockType.DYNAMIC); + .exactAllocate(DataNodeMemoryConfig.SCHEMA_REGION, MemoryBlockType.DYNAMIC); private final ClusterTemplateManager clusterTemplateManager = ClusterTemplateManager.getInstance();
