You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/04/29 01:49:08 UTC
[iotdb] 01/01: reduece the last log,
only print details while debuging
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch LastLog12
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 0426d7f5cdb3e17c23312f6dab9c0d73335c4a70
Author: JackieTien97 <Ja...@foxmail.com>
AuthorDate: Thu Apr 29 09:48:24 2021 +0800
reduece the last log, only print details while debuging
---
.../iotdb/db/query/executor/LastQueryExecutor.java | 41 ++++++++++++++--------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java b/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
index 3bd3eb1..d6a3169 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/executor/LastQueryExecutor.java
@@ -152,7 +152,13 @@ public class LastQueryExecutor {
List<TSDataType> nonCachedDataTypes = new ArrayList<>();
List<Pair<Boolean, TimeValuePair>> resultContainer =
readLastPairsFromCache(
- seriesPaths, dataTypes, filter, cacheAccessors, nonCachedPaths, nonCachedDataTypes);
+ seriesPaths,
+ dataTypes,
+ filter,
+ cacheAccessors,
+ nonCachedPaths,
+ nonCachedDataTypes,
+ context.isDebug());
if (nonCachedPaths.isEmpty()) {
return resultContainer;
}
@@ -189,10 +195,12 @@ public class LastQueryExecutor {
resultContainer.get(i).left = true;
if (CACHE_ENABLED) {
cacheAccessors.get(i).write(resultContainer.get(i).right);
- DEBUG_LOGGER.info(
- "[LastQueryExecutor] Update last cache for path: {} with timestamp: {}",
- seriesPaths,
- resultContainer.get(i).right.getTimestamp());
+ if (context.isDebug()) {
+ DEBUG_LOGGER.info(
+ "[LastQueryExecutor] Update last cache for path: {} with timestamp: {}",
+ seriesPaths,
+ resultContainer.get(i).right.getTimestamp());
+ }
}
}
}
@@ -206,7 +214,8 @@ public class LastQueryExecutor {
Filter filter,
List<LastCacheAccessor> cacheAccessors,
List<PartialPath> restPaths,
- List<TSDataType> restDataType) {
+ List<TSDataType> restDataType,
+ boolean debugOn) {
List<Pair<Boolean, TimeValuePair>> resultContainer = new ArrayList<>();
if (CACHE_ENABLED) {
for (PartialPath path : seriesPaths) {
@@ -227,16 +236,20 @@ public class LastQueryExecutor {
restDataType.add(dataTypes.get(i));
} else if (!satisfyFilter(filter, tvPair)) {
resultContainer.add(new Pair<>(true, null));
- DEBUG_LOGGER.info(
- "[LastQueryExecutor] Last cache hit for path: {} with timestamp: {}",
- seriesPaths.get(i),
- tvPair.getTimestamp());
+ if (debugOn) {
+ DEBUG_LOGGER.info(
+ "[LastQueryExecutor] Last cache hit for path: {} with timestamp: {}",
+ seriesPaths.get(i),
+ tvPair.getTimestamp());
+ }
} else {
resultContainer.add(new Pair<>(true, tvPair));
- DEBUG_LOGGER.info(
- "[LastQueryExecutor] Last cache hit for path: {} with timestamp: {}",
- seriesPaths.get(i),
- tvPair.getTimestamp());
+ if (debugOn) {
+ DEBUG_LOGGER.info(
+ "[LastQueryExecutor] Last cache hit for path: {} with timestamp: {}",
+ seriesPaths.get(i),
+ tvPair.getTimestamp());
+ }
}
}
return resultContainer;