You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/07/25 08:06:51 UTC

[incubator-iotdb] branch fix_load_tsfile_0.10 created (now 5a5738f)

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

qiaojialin pushed a change to branch fix_load_tsfile_0.10
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 5a5738f  fix set historical version when loading tsfile

This branch includes the following new commits:

     new 5a5738f  fix set historical version when loading tsfile

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: fix set historical version when loading tsfile

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch fix_load_tsfile_0.10
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 5a5738fcb51817b06c041a15eb2d6a0a1f907ba9
Author: qiaojialin <64...@qq.com>
AuthorDate: Sat Jul 25 16:06:32 2020 +0800

    fix set historical version when loading tsfile
---
 .../java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java  | 2 +-
 .../src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
index e3f7206..267d416 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
@@ -99,7 +99,7 @@ public class TsFileResource {
   // its historicalVersions are the union of all TsFiles' historicalVersions that joined this merge.
   // This field helps us compare the files that are generated by different IoTDBs that share the
   // same file generation policy but have their own merge policies.
-  private Set<Long> historicalVersions;
+  private Set<Long> historicalVersions = new HashSet<>();
 
   /**
    * Chunk metadata list of unsealed tsfile. Only be set in a temporal TsFileResource in a query
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index b5ba4ef..973057a 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -726,6 +726,10 @@ public class PlanExecutor implements IPlanExecutor {
       return;
     }
     TsFileResource tsFileResource = new TsFileResource(file);
+    long fileVersion =
+        Long.parseLong(
+            tsFileResource.getFile().getName().split(IoTDBConstant.TSFILE_NAME_SEPARATOR)[1]);
+    tsFileResource.setHistoricalVersions(Collections.singleton(fileVersion));
     tsFileResource.setClosed(true);
     try {
       // check file