You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hu...@apache.org on 2023/04/11 15:19:58 UTC

[iotdb] 03/03: tmp save

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

hui pushed a commit to branch lmh/groupByTest
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c1d7b0952027d89c9984329b76230245a986c714
Author: Minghui Liu <li...@foxmail.com>
AuthorDate: Tue Apr 11 20:54:07 2023 +0800

    tmp save
---
 .../operator/sink/IdentitySinkOperator.java        |  4 +--
 .../AbstractSeriesAggregationScanOperator.java     | 38 +++++++++++-----------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
index 80ac16af92..ec10b22497 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
@@ -57,7 +57,7 @@ public class IdentitySinkOperator implements Operator {
   public boolean hasNext() throws Exception {
     int currentIndex = downStreamChannelIndex.getCurrentIndex();
     boolean currentChannelClosed = sinkHandle.isChannelClosed(currentIndex);
-    if (!currentChannelClosed && children.get(currentIndex).hasNext()) {
+    if (!currentChannelClosed && children.get(currentIndex).hasNextWithTimer()) {
       return true;
     } else if (currentChannelClosed) {
       // we close the child directly. The child could be an ExchangeOperator which is the downstream
@@ -96,7 +96,7 @@ public class IdentitySinkOperator implements Operator {
       needToReturnNull = false;
       return null;
     }
-    return children.get(downStreamChannelIndex.getCurrentIndex()).next();
+    return children.get(downStreamChannelIndex.getCurrentIndex()).nextWithTimer();
   }
 
   @Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
index 067c14787e..f1eb150626 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
@@ -242,9 +242,9 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
   }
 
   protected boolean readAndCalcFromFile() throws IOException {
-    while (seriesScanUtil.hasNextFile()) {
-      long startTime = System.nanoTime();
-      try {
+    long startTime = System.nanoTime();
+    try {
+      while (seriesScanUtil.hasNextFile()) {
         if (canUseCurrentFileStatistics()) {
           Statistics fileTimeStatistics = seriesScanUtil.currentFileTimeStatistics();
           if (fileTimeStatistics.getStartTime() > curTimeRange.getMax()) {
@@ -273,21 +273,21 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
         }
 
         // read chunk
+
         if (readAndCalcFromChunk()) {
           return true;
         }
-      } finally {
-        operatorContext.addOperatorTime(CAL_AGG_FROM_FILE, System.nanoTime() - startTime);
       }
+      return false;
+    } finally {
+      operatorContext.addOperatorTime(CAL_AGG_FROM_FILE, System.nanoTime() - startTime);
     }
-
-    return false;
   }
 
   protected boolean readAndCalcFromChunk() throws IOException {
-    while (seriesScanUtil.hasNextChunk()) {
-      long startTime = System.nanoTime();
-      try {
+    long startTime = System.nanoTime();
+    try {
+      while (seriesScanUtil.hasNextChunk()) {
         if (canUseCurrentChunkStatistics()) {
           Statistics chunkTimeStatistics = seriesScanUtil.currentChunkTimeStatistics();
           if (chunkTimeStatistics.getStartTime() > curTimeRange.getMax()) {
@@ -320,17 +320,17 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
         if (readAndCalcFromPage()) {
           return true;
         }
-      } finally {
-        operatorContext.addOperatorTime(CAL_AGG_FROM_CHUNK, System.nanoTime() - startTime);
       }
+      return false;
+    } finally {
+      operatorContext.addOperatorTime(CAL_AGG_FROM_CHUNK, System.nanoTime() - startTime);
     }
-    return false;
   }
 
   protected boolean readAndCalcFromPage() throws IOException {
-    while (seriesScanUtil.hasNextPage()) {
-      long startTime = System.nanoTime();
-      try {
+    long startTime = System.nanoTime();
+    try {
+      while (seriesScanUtil.hasNextPage()) {
         if (canUseCurrentPageStatistics()) {
           Statistics pageTimeStatistics = seriesScanUtil.currentPageTimeStatistics();
           // There is no more eligible points in current time range
@@ -369,11 +369,11 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
         if (calcFromRawData(tsBlock)) {
           return true;
         }
-      } finally {
-        operatorContext.addOperatorTime(CAL_AGG_FROM_PAGE, System.nanoTime() - startTime);
       }
+      return false;
+    } finally {
+      operatorContext.addOperatorTime(CAL_AGG_FROM_PAGE, System.nanoTime() - startTime);
     }
-    return false;
   }
 
   protected boolean canUseCurrentFileStatistics() throws IOException {