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 2019/11/26 04:39:31 UTC

[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request #575: Add CN document of TsFile

qiaojialin commented on a change in pull request #575: Add CN document of TsFile
URL: https://github.com/apache/incubator-iotdb/pull/575#discussion_r350540698
 
 

 ##########
 File path: docs/Documentation-CHN/UserGuide/8-System Design (Developer)/1-Hierarchy.md
 ##########
 @@ -21,4 +21,399 @@
 
 # 第8章: 系统设计
 
-Coming Soon.
\ No newline at end of file
+## 1. TsFile 设计
+
+  本章是关于 TsFile 的设计细节.
+
+### 1.1 变量的存储
+
+- **大端存储**
+  - 比如: `int` `0x8` 将会被存储为 `00 00 00 08`, 而不是 `08 00 00 00`
+- **可变长的字符串类型**
+  - 存储的方式是以一个 `int` 类型的 `Size` + 字符串组成。`Size` 的值可以为 0。
+  - `Size` 指的是字符串所占的字节数,它并不一定等于字符串的长度. 
+  - 举例来说,"sensor_1" 这个字符串将被存储为 `00 00 00 08` + "sensor_1" (ASCII编码)。
+  - 另外需要注意的一点是 "Magic String"(文件签名)"TsFile000001", 因为他的 `Size(12)` 和 ASCII 编码值是固定的,所以没有必要在这个字符串前的写入 `Size` 值。
+- **数据类型的编码**
+  - 0: BOOLEAN
+  - 1: INT32 (`int`)
+  - 2: INT64 (`long`)
+  - 3: FLOAT
+  - 4: DOUBLE
+  - 5: TEXT (`String`)
+- **编码类型的编码**
+  - 0: PLAIN
+  - 1: PLAIN_DICTIONARY
+  - 2: RLE
+  - 3: DIFF
+  - 4: TS_2DIFF
+  - 5: BITMAP
+  - 6: GORILLA
+  - 7: REGULAR 
+- **压缩类型的编码**
+  - 0: UNCOMPRESSED
+  - 1: SNAPPY
+  - 2: GZIP
+  - 3: LZO (暂未实现)
 
 Review comment:
   文档要跟当前代码对应,没有就删掉,GZIP就没有

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services