This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new 0355587e02c [To dev/1.3] Print debug log only if debug is enbale
0355587e02c is described below

commit 0355587e02ca4e73aed00e78858b2e302ed8a162
Author: Jackie Tien <[email protected]>
AuthorDate: Fri Mar 21 14:17:12 2025 +0800

    [To dev/1.3] Print debug log only if debug is enbale
---
 .../analyze/cache/partition/PartitionCache.java    | 26 +++++++++++++---------
 1 file changed, 16 insertions(+), 10 deletions(-)

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 1d8e8b38a49..6d60597ffe8 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
@@ -649,7 +649,7 @@ public class PartitionCache {
       Map<String, List<DataPartitionQueryParam>> storageGroupToQueryParamsMap) 
{
     dataPartitionCacheLock.readLock().lock();
     try {
-      if (storageGroupToQueryParamsMap.size() == 0) {
+      if (storageGroupToQueryParamsMap.isEmpty()) {
         cacheMetrics.record(false, CacheMetrics.DATA_PARTITION_CACHE_NAME);
         return null;
       }
@@ -665,7 +665,9 @@ public class PartitionCache {
           return null;
         }
       }
-      logger.debug("[{} Cache] hit", CacheMetrics.DATA_PARTITION_CACHE_NAME);
+      if (logger.isDebugEnabled()) {
+        logger.debug("[{} Cache] hit", CacheMetrics.DATA_PARTITION_CACHE_NAME);
+      }
       // cache hit
       cacheMetrics.record(true, CacheMetrics.DATA_PARTITION_CACHE_NAME);
       return new DataPartition(dataPartitionMap, seriesSlotExecutorName, 
seriesPartitionSlotNum);
@@ -689,10 +691,12 @@ public class PartitionCache {
       List<DataPartitionQueryParam> dataPartitionQueryParams) {
     DataPartitionTable dataPartitionTable = 
dataPartitionCache.getIfPresent(storageGroupName);
     if (null == dataPartitionTable) {
-      logger.debug(
-          "[{} Cache] miss when search database {}",
-          CacheMetrics.DATA_PARTITION_CACHE_NAME,
-          storageGroupName);
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "[{} Cache] miss when search database {}",
+            CacheMetrics.DATA_PARTITION_CACHE_NAME,
+            storageGroupName);
+      }
       return false;
     }
     Map<TSeriesPartitionSlot, SeriesPartitionTable> 
cachedStorageGroupPartitionMap =
@@ -776,10 +780,12 @@ public class PartitionCache {
     if (null == cacheConsensusGroupId
         || cacheConsensusGroupId.isEmpty()
         || null == timePartitionSlot) {
-      logger.debug(
-          "[{} Cache] miss when search time partition {}",
-          CacheMetrics.DATA_PARTITION_CACHE_NAME,
-          timePartitionSlot);
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "[{} Cache] miss when search time partition {}",
+            CacheMetrics.DATA_PARTITION_CACHE_NAME,
+            timePartitionSlot);
+      }
       return false;
     }
     List<TRegionReplicaSet> regionReplicaSets = new LinkedList<>();

Reply via email to