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

leirui pushed a commit to branch research/M4-visualization
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/research/M4-visualization by 
this push:
     new a852fdd6e0 fix
a852fdd6e0 is described below

commit a852fdd6e030e1d99056c2ab1692576e3479bbc5
Author: Lei Rui <[email protected]>
AuthorDate: Tue Jun 28 14:57:32 2022 +0800

    fix
---
 .../groupby/GroupByWithoutValueFilterDataSet.java  |   4 +-
 .../dataset/groupby/LocalGroupByExecutor4CPV.java  | 125 ++++++++++-----------
 .../iotdb/db/query/udf/builtin/UDTFM4MAC.java      |   2 +-
 .../org/apache/iotdb/db/service/TSServiceImpl.java |   2 +-
 .../java/org/apache/iotdb/db/utils/QueryUtils.java |  22 ++--
 5 files changed, 75 insertions(+), 80 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
index bd4e28e67b..bbc8ee7ef8 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
@@ -198,11 +198,11 @@ public class GroupByWithoutValueFilterDataSet extends 
GroupByEngineDataSet {
       boolean ascending)
       throws StorageEngineException, QueryProcessException {
     if (CONFIG.isEnableCPV()) {
-      System.out.println("[[[[[M4]]]]] use LocalGroupByExecutor4CPV for CPV");
+//      System.out.println("====DEBUG====: use LocalGroupByExecutor4CPV for 
CPV");
       return new LocalGroupByExecutor4CPV(
           path, allSensors, dataType, context, timeFilter, fileFilter, 
ascending);
     } else {
-      System.out.println("[[[[[M4]]]]] use LocalGroupByExecutor for MOC");
+//      System.out.println("====DEBUG====: use LocalGroupByExecutor for MOC");
       return new LocalGroupByExecutor(
           path, allSensors, dataType, context, timeFilter, fileFilter, 
ascending);
     }
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
index 02c87ad908..b63a84d321 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
@@ -93,7 +93,6 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
     this.tsDataType = dataType;
     this.mergeReader = new PriorityMergeReader();
 
-    // TODO: load all chunk metadatas into futureChunkList
     // get all data sources
     QueryDataSource queryDataSource =
         QueryResourceManager.getInstance().getQueryDataSource(path, context, 
this.timeFilter);
@@ -114,6 +113,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
             ascending);
 
     // unpackAllOverlappedFilesToTimeSeriesMetadata
+    // TODO: this might be bad to load all chunk metadata at first
     try {
       futureChunkList.addAll(seriesReader.getAllChunkMetadatas4CPV());
     } catch (IOException e) {
@@ -136,8 +136,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
   public List<AggregateResult> calcResult(
       long curStartTime, long curEndTime, long startTime, long endTime, long 
interval)
       throws IOException, QueryProcessException {
-    //    System.out.println("====DEBUG====: calcResult for [" + curStartTime 
+ "," + curEndTime +
-    // ")");
+//    System.out.println("====DEBUG====: calcResult for [" + curStartTime + 
"," + curEndTime + ")");
 
     // clear result cache
     for (AggregateResult result : results) {
@@ -146,7 +145,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
     // empty currentChunkList
     currentChunkList = new ArrayList<>();
 
-    //    System.out.println("====DEBUG====: deal with futureChunkList");
+//    System.out.println("====DEBUG====: deal with futureChunkList");
 
     ListIterator itr = futureChunkList.listIterator();
     List<ChunkSuit4CPV> tmpFutureChunkList = new ArrayList<>();
@@ -187,18 +186,18 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                   chunkMetadata);
         }
 
-        //        System.out.println(
-        //            "====DEBUG====: load the chunk because overlaps the M4 
interval. Version="
-        //                + chunkMetadata.getVersion()
-        //                + " "
-        //                + chunkMetadata.getOffsetOfChunkHeader());
+//        System.out.println(
+//            "====DEBUG====: load the chunk because overlaps the M4 interval. 
Version="
+//                + chunkMetadata.getVersion()
+//                + " "
+//                + chunkMetadata.getOffsetOfChunkHeader());
       }
     }
     futureChunkList.addAll(tmpFutureChunkList);
     tmpFutureChunkList = null;
     itr = null;
 
-    //    System.out.println("====DEBUG====: deal with currentChunkList");
+//    System.out.println("====DEBUG====: deal with currentChunkList");
 
     if (currentChunkList.size() == 0) {
       return results;
@@ -217,7 +216,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
       values[3] = null;
 
       // find candidate points
-      //      System.out.println("====DEBUG====: find candidate points");
+//      System.out.println("====DEBUG====: find candidate points");
 
       for (int j = 0; j < currentChunkList.size(); j++) {
         ChunkMetadata chunkMetadata = 
currentChunkList.get(j).getChunkMetadata();
@@ -270,7 +269,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
         }
       }
 
-      //      System.out.println("====DEBUG====: verify candidate points");
+//      System.out.println("====DEBUG====: verify candidate points");
 
       // verify candidate points.
       // firstPoint and lastPoint are valid for sure.
@@ -291,12 +290,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
           }
         }
         if (isDeletedItself) {
-          //          System.out.println(
-          //              "====DEBUG====: load the chunk because candidate 
firstPoint is actually
-          // deleted. Version="
-          //                  + firstChunkMetadata.getVersion()
-          //                  + " "
-          //                  + firstChunkMetadata.getOffsetOfChunkHeader());
+//          System.out.println(
+//              "====DEBUG====: load the chunk because candidate firstPoint is 
actually deleted. Version="
+//                  + firstChunkMetadata.getVersion()
+//                  + " "
+//                  + firstChunkMetadata.getOffsetOfChunkHeader());
 
           currentChunkList.remove(listIdx[0]);
           List<IPageReader> pageReaderList =
@@ -327,7 +325,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                   1,
                   Arrays.copyOfRange(values, 0, 1)); // first_value
           isFinal[0] = true;
-          //          System.out.println("====DEBUG====: find firstPoint");
+//          System.out.println("====DEBUG====: find firstPoint");
         }
       }
       if (!isFinal[1]) { // lastPoint
@@ -345,12 +343,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
           }
         }
         if (isDeletedItself) {
-          //          System.out.println(
-          //              "====DEBUG====: load the chunk because candidate 
lastPoint is actually
-          // deleted. Version="
-          //                  + lastChunkMetadata.getVersion()
-          //                  + " "
-          //                  + lastChunkMetadata.getOffsetOfChunkHeader());
+//          System.out.println(
+//              "====DEBUG====: load the chunk because candidate lastPoint is 
actually deleted. Version="
+//                  + lastChunkMetadata.getVersion()
+//                  + " "
+//                  + lastChunkMetadata.getOffsetOfChunkHeader());
 
           currentChunkList.remove(listIdx[1]);
           List<IPageReader> pageReaderList =
@@ -382,7 +379,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                   Arrays.copyOfRange(values, 1, 2)); // first_value
           isFinal[1] = true;
 
-          //          System.out.println("====DEBUG====: find lastPoint");
+//          System.out.println("====DEBUG====: find lastPoint");
         }
       }
       if (!isFinal[2]) { // bottomPoint
@@ -402,12 +399,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
           }
         }
         if (isDeletedItself) {
-          //          System.out.println(
-          //              "====DEBUG====: load the chunk because candidate 
bottomPoint is actually
-          // deleted. Version="
-          //                  + bottomChunkMetadata.getVersion()
-          //                  + " "
-          //                  + bottomChunkMetadata.getOffsetOfChunkHeader());
+//          System.out.println(
+//              "====DEBUG====: load the chunk because candidate bottomPoint 
is actually deleted. Version="
+//                  + bottomChunkMetadata.getVersion()
+//                  + " "
+//                  + bottomChunkMetadata.getOffsetOfChunkHeader());
 
           currentChunkList.remove(listIdx[2]);
           List<IPageReader> pageReaderList =
@@ -454,7 +450,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
             toMerge.add(i);
           }
           if (toMerge.isEmpty()) {
-            //            System.out.println("====DEBUG====: find 
bottomPoint");
+//            System.out.println("====DEBUG====: find bottomPoint");
 
             results
                 .get(4)
@@ -522,11 +518,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                 currentChunkList.set(toMerge.get(o), 
tmpCurrentChunkList.get(0));
                 chunkSuit4CPV = currentChunkList.get(toMerge.get(o));
 
-                //                System.out.println(
-                //                    "====DEBUG====: load chunk for update 
merge. Version="
-                //                        + chunkMetadata.getVersion()
-                //                        + " "
-                //                        + 
chunkMetadata.getOffsetOfChunkHeader());
+//                System.out.println(
+//                    "====DEBUG====: load chunk for update merge. Version="
+//                        + chunkMetadata.getVersion()
+//                        + " "
+//                        + chunkMetadata.getOffsetOfChunkHeader());
               }
               mergeReader.addReader(
                   chunkSuit4CPV.getBatchData().getBatchDataIterator(),
@@ -535,11 +531,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
             while (mergeReader.hasNextTimeValuePair()) {
               Pair<TimeValuePair, MergeReaderPriority> res = 
mergeReader.nextElement();
               TimeValuePair ret = res.left;
-              //                            System.out.println(
-              //                                "====DEBUG====: merge for 
bottomPoint. (t,v)="
-              //                                    + ret.getTimestamp()
-              //                                    + ","
-              //                                    + 
ret.getValue().getValue());
+//              System.out.println(
+//                  "====DEBUG====: merge for bottomPoint. (t,v)="
+//                      + ret.getTimestamp()
+//                      + ","
+//                      + ret.getValue().getValue());
               updateBatchDataMap
                   .get(res.right)
                   .putAnObject(ret.getTimestamp(), ret.getValue().getValue());
@@ -583,11 +579,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                   .getChunkMetadata()
                   .setStatistics(statisticsMap.get(mergeReaderPriority));
             }
-            //            System.out.println(
-            //                "====DEBUG====: merged chunks are : version="
-            //                    + newMergedVersionList
-            //                    + " offsets="
-            //                    + newMergedOffsetList);
+//            System.out.println(
+//                "====DEBUG====: merged chunks are : version="
+//                    + newMergedVersionList
+//                    + " offsets="
+//                    + newMergedOffsetList);
             continue;
           }
         }
@@ -610,12 +606,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
           }
         }
         if (isDeletedItself) {
-          //          System.out.println(
-          //              "====DEBUG====: load the chunk because candidate 
topPoint is actually
-          // deleted. Version="
-          //                  + topChunkMetadata.getVersion()
-          //                  + " "
-          //                  + topChunkMetadata.getOffsetOfChunkHeader());
+//          System.out.println(
+//              "====DEBUG====: load the chunk because candidate topPoint is 
actually deleted. Version="
+//                  + topChunkMetadata.getVersion()
+//                  + " "
+//                  + topChunkMetadata.getOffsetOfChunkHeader());
 
           currentChunkList.remove(listIdx[3]);
           List<IPageReader> pageReaderList =
@@ -668,7 +663,7 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                     1,
                     Arrays.copyOfRange(values, 3, 4)); // max_value
             isFinal[3] = true;
-            //            System.out.println("====DEBUG====: find topPoint");
+//            System.out.println("====DEBUG====: find topPoint");
             return results;
           } else {
             // deal with toMerge chunks: delete updated points
@@ -729,11 +724,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
                 currentChunkList.set(toMerge.get(o), 
tmpCurrentChunkList.get(0));
                 chunkSuit4CPV = currentChunkList.get(toMerge.get(o));
 
-                //                System.out.println(
-                //                    "====DEBUG====: load chunk for update 
merge. Version="
-                //                        + chunkMetadata.getVersion()
-                //                        + " "
-                //                        + 
chunkMetadata.getOffsetOfChunkHeader());
+//                System.out.println(
+//                    "====DEBUG====: load chunk for update merge. Version="
+//                        + chunkMetadata.getVersion()
+//                        + " "
+//                        + chunkMetadata.getOffsetOfChunkHeader());
               }
               mergeReader.addReader(
                   chunkSuit4CPV.getBatchData().getBatchDataIterator(),
@@ -742,11 +737,11 @@ public class LocalGroupByExecutor4CPV implements 
GroupByExecutor {
             while (mergeReader.hasNextTimeValuePair()) {
               Pair<TimeValuePair, MergeReaderPriority> res = 
mergeReader.nextElement();
               TimeValuePair ret = res.left;
-              //              System.out.println(
-              //                  "====DEBUG====: merge for topPoint. (t,v)="
-              //                      + ret.getTimestamp()
-              //                      + ","
-              //                      + ret.getValue().getValue());
+//              System.out.println(
+//                  "====DEBUG====: merge for topPoint. (t,v)="
+//                      + ret.getTimestamp()
+//                      + ","
+//                      + ret.getValue().getValue());
               updateBatchDataMap
                   .get(res.right)
                   .putAnObject(ret.getTimestamp(), ret.getValue().getValue());
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java 
b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
index 21168e38eb..3d087dada8 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
@@ -128,7 +128,7 @@ public class UDTFM4MAC implements UDTF {
     for (int i = 0; i < w; i++) {
       result[i] = "empty";
     }
-    System.out.println("[[[[[M4]]]]] use UDTFM4MAC for MAC");
+//    System.out.println("====DEBUG====: use UDTFM4MAC for MAC");
   }
 
   @Override
diff --git 
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java 
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index a3b112401c..ae5511987d 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -637,7 +637,7 @@ public class TSServiceImpl implements TSIService.Iface {
       PhysicalPlan physicalPlan =
           processor.parseSQLToPhysicalPlan(
               statement, sessionManager.getZoneId(req.sessionId), 
req.fetchSize);
-      System.out.println("[[[[[M4]]]]] fetchSize=" + req.fetchSize);
+//      System.out.println("====DEBUG====: fetchSize=" + req.fetchSize);
       return physicalPlan.isQuery()
           ? internalExecuteQueryStatement(
               statement,
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java 
b/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
index c505895910..81346ae261 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
@@ -112,17 +112,17 @@ public class QueryUtils {
   private static void doModifyChunkMetaData(Modification modification, 
ChunkMetadata metaData) {
     if (modification instanceof Deletion) {
       Deletion deletion = (Deletion) modification;
-      System.out.println(
-          "====DEBUG====: doModifyChunkMetaData/insertIntoSortedDeletions: "
-              + "chunkTime=["
-              + metaData.getStartTime()
-              + ","
-              + metaData.getEndTime()
-              + "],deleteTime=["
-              + deletion.getStartTime()
-              + ","
-              + deletion.getEndTime()
-              + "]");
+//      System.out.println(
+//          "====DEBUG====: doModifyChunkMetaData/insertIntoSortedDeletions: "
+//              + "chunkTime=["
+//              + metaData.getStartTime()
+//              + ","
+//              + metaData.getEndTime()
+//              + "],deleteTime=["
+//              + deletion.getStartTime()
+//              + ","
+//              + deletion.getEndTime()
+//              + "]");
       metaData.insertIntoSortedDeletions(deletion.getStartTime(), 
deletion.getEndTime());
     }
   }

Reply via email to