You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/12/21 09:01:50 UTC
(iotdb) branch avoid_read_disk_recover_last_time created (now aa0aaa11ac3)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a change to branch avoid_read_disk_recover_last_time
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at aa0aaa11ac3 dev
This branch includes the following new commits:
new aa0aaa11ac3 dev
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.
(iotdb) 01/01: dev
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch avoid_read_disk_recover_last_time
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit aa0aaa11ac36eab03275d4346dcf632275c48780
Author: HTHou <hh...@outlook.com>
AuthorDate: Thu Dec 21 15:42:53 2023 +0800
dev
---
.../db/storageengine/dataregion/tsfile/TsFileManager.java | 13 +++++++++----
.../db/storageengine/dataregion/LastFlushTimeMapTest.java | 2 ++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java
index 53a6ee357b6..69a3cff6901 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java
@@ -20,6 +20,7 @@
package org.apache.iotdb.db.storageengine.dataregion.tsfile;
import org.apache.iotdb.commons.utils.TimePartitionUtils;
+import org.apache.iotdb.db.storageengine.dataregion.tsfile.timeindex.ITimeIndex;
import org.apache.iotdb.db.storageengine.rescon.memory.TsFileResourceManager;
import java.io.IOException;
@@ -119,10 +120,14 @@ public class TsFileManager {
if (!seqResource.isClosed()) {
continue;
}
- Set<String> deviceSet = seqResource.getDevices();
- if (deviceSet.contains(devicePath)) {
- lastFlushTime = seqTsFileResourceList.get(i).getEndTime(devicePath);
- break;
+ if (seqResource.getTimeIndexType() == ITimeIndex.DEVICE_TIME_INDEX_TYPE) {
+ Set<String> deviceSet = seqResource.getDevices();
+ if (deviceSet.contains(devicePath)) {
+ lastFlushTime = Math.max(lastFlushTime, seqResource.getEndTime(devicePath));
+ break;
+ }
+ } else {
+ lastFlushTime = Math.max(lastFlushTime, seqResource.getEndTime(devicePath));
}
}
List<TsFileResource> unseqTsFileResourceList =
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
index ffdb1177a39..55ce6ef22f6 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/LastFlushTimeMapTest.java
@@ -139,6 +139,8 @@ public class LastFlushTimeMapTest {
}
Assert.assertEquals(
10000, dataRegion.getLastFlushTimeMap().getFlushedTime(0, "root.vehicle.d0"));
+ Assert.assertEquals(
+ 10000, dataRegion.getLastFlushTimeMap().getFlushedTime(0, "root.vehicle.d1"));
}
@Test