You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/12/29 07:37:56 UTC

[GitHub] [iotdb] JackieTien97 commented on a change in pull request #4650: [To rel/0.12] [IOTDB-2221] Accelerate query when all the selected series are under the same device

JackieTien97 commented on a change in pull request #4650:
URL: https://github.com/apache/iotdb/pull/4650#discussion_r776188349



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
##########
@@ -632,12 +667,7 @@ public boolean isSatisfied(Filter timeFilter, boolean isSeq, long ttl, boolean d
 
   /** @return true if the device is contained in the TsFile and it lives beyond TTL */

Review comment:
       ```suggestion
     /** @return true if the device is contained in the TsFile */
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
##########
@@ -608,6 +608,41 @@ public boolean stillLives(long timeLowerBound) {
     return timeIndex.stillLives(timeLowerBound);
   }
 
+  public boolean isSatisfied(
+      String deviceId, Filter timeFilter, boolean isSeq, long ttl, boolean debug) {
+    if (deviceId == null) {
+      return isSatisfied(timeFilter, isSeq, ttl, debug);
+    }
+
+    if (!getDevices().contains(deviceId)) {
+      if (debug) {
+        DEBUG_LOGGER.info(
+            "Path: {} file {} is not satisfied because of no device!", deviceId, file);
+      }
+      return false;
+    }
+
+    long startTime = getStartTime(deviceId);
+    long endTime = closed || !isSeq ? getEndTime(deviceId) : Long.MAX_VALUE;
+
+    if (!isAlive(endTime, ttl)) {
+      if (debug) {
+        DEBUG_LOGGER.info("file {} is not satisfied because of ttl!", file);
+      }
+      return false;
+    }
+
+    if (timeFilter != null) {
+      boolean res = timeFilter.satisfyStartEndTime(startTime, endTime);
+      if (debug && !res) {
+        DEBUG_LOGGER.info(
+            "Path: {} file {} is not satisfied because of time filter!", deviceId, fsFactory);
+      }
+      return res;
+    }
+    return true;
+  }
+
   /** @return true if the TsFile lives beyond TTL */
   public boolean isSatisfied(Filter timeFilter, boolean isSeq, long ttl, boolean debug) {

Review comment:
       ```suggestion
     private boolean isSatisfied(Filter timeFilter, boolean isSeq, long ttl, boolean debug) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org