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/23 15:24:27 UTC

[incubator-iotdb] branch master updated: update new range delete doc

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 0b788bb  update new range delete doc
0b788bb is described below

commit 0b788bb1a885248984e071af4737444b1697a9be
Author: wshao08 <ko...@163.com>
AuthorDate: Thu Jul 23 11:13:38 2020 +0800

    update new range delete doc
---
 docs/SystemDesign/StorageEngine/DataManipulation.md    | 12 +++++++++---
 docs/zh/SystemDesign/StorageEngine/DataManipulation.md | 12 ++++++++----
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/docs/SystemDesign/StorageEngine/DataManipulation.md b/docs/SystemDesign/StorageEngine/DataManipulation.md
index 88ed345..8a3907f 100644
--- a/docs/SystemDesign/StorageEngine/DataManipulation.md
+++ b/docs/SystemDesign/StorageEngine/DataManipulation.md
@@ -74,14 +74,20 @@ Each StorageGroupProcessor maintains a ascending version for each partition, whi
 Each memtable will apply a version when submitted to flush. After flushing to TsFile, a current position-version will added to TsFileMetadata. 
 This information will be used to set version to ChunkMetadata when query.
 
-* main entrance: public void delete(String deviceId, String measurementId, long timestamp) StorageEngine.java
+Main entrance in StorageEngine.java: 
+ 
+```public void delete(String deviceId, String measurementId, long startTime, long endTime)```
+
   * Find the corresponding StorageGroupProcessor
   * Find all impacted working TsFileProcessors to write WAL
-  * Find all impacted TsFileResources to record a Modification in its mods file, the Modification format is: path,deleteTime,version
+  * Find all impacted TsFileResources to record a Modification in its mods file, the Modification format is: path,version, startTime, endTime
   * If the TsFile is not closed,get its TsFileProcessor
     * If there exists the working memtable, delete data in it
-    * If there exists flushing memtable,record the deleted time in it for query.(Notice that the Modification is recorded in mods for these memtables)
+    * If there exists flushing memtable,record the deleted start time and end time in it for query.(Notice that the Modification is recorded in mods for these memtables)
 
+The Mods file stores records of delete information.
+For the following mods file, data of d1.s1 falls in range [100, 200], [180, 300], and data of d1.s2 falls in range [500, 1000] are deleted.
+![](https://user-images.githubusercontent.com/59866276/88248546-20952600-ccd4-11ea-88e9-84af8dde4304.jpg)
 ## Data TTL setting
 
 * Corresponding interface
diff --git a/docs/zh/SystemDesign/StorageEngine/DataManipulation.md b/docs/zh/SystemDesign/StorageEngine/DataManipulation.md
index 188b8b3..a5526b8 100644
--- a/docs/zh/SystemDesign/StorageEngine/DataManipulation.md
+++ b/docs/zh/SystemDesign/StorageEngine/DataManipulation.md
@@ -75,15 +75,19 @@
 每个 StorageGroupProsessor 中针对每个分区会维护一个自增的版本号,由 SimpleFileVersionController 管理。
 每个内存缓冲区 memtable 在持久化的时候会申请一个版本号。持久化到 TsFile 后,会在 TsFileMetadata 中记录此 memtable 对应的 多个 ChunkGroup 的终止位置和版本号。
 查询时会根据此信息对 ChunkMetadata 赋 version。
-​	
-* 总入口: public void delete(String deviceId, String measurementId, long timestamp) StorageEngine.java
+
+StorageEngine.java中的delete入口: 
+
+```public void delete(String deviceId, String measurementId, long timestamp)```
   * 找到对应的 StorageGroupProcessor
   * 找到受影响的所有 working TsFileProcessor 记录写前日志
-  * 找到受影响的所有 TsFileResource,在其对应的 mods 文件中记录一条记录:path,deleteTime,version
-  * 如果文件没有关闭,拿到对应的 TsFileProcessor
+  * 找到受影响的所有 TsFileResource,在其对应的 mods 文件中记录一条记录:path,version,startTime,endTime
     * 如果存在 working memtable:则删除内存中的数据
     * 如果存在 正在 flush 的 memtable,记录一条记录,查询时跳过删掉的数据(注意此时文件中已经为这些 memtable 记录了 mods)
 
+Mods文件用来存储所有的删除记录。下图的mods文件中,d1.s1落在 [100, 200], [180, 300]范围的数据,以及d1.s2落在[500, 1000]范围中的数据将会被删除。
+
+![](https://user-images.githubusercontent.com/59866276/88248546-20952600-ccd4-11ea-88e9-84af8dde4304.jpg)
 
 ## 数据TTL设置