This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 0c85956 [IOTDB-716] add lz4 doc and support compression=lz4 statement
(#1860)
0c85956 is described below
commit 0c8595603bb4470bd998ef9397c31baf878f62c4
Author: Haonan <[email protected]>
AuthorDate: Mon Oct 26 23:02:34 2020 +0800
[IOTDB-716] add lz4 doc and support compression=lz4 statement (#1860)
---
antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 | 5 +++++
docs/SystemDesign/TsFile/Format.md | 1 +
docs/UserGuide/Concept/Compression.md | 4 +++-
docs/zh/SystemDesign/TsFile/Format.md | 1 +
docs/zh/UserGuide/Concept/Compression.md | 3 ++-
.../main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java | 3 +--
6 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
index c7bba59..ef27c2c 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
@@ -181,6 +181,7 @@ compressor
| SDT
| PAA
| PLA
+ | LZ4
;
attributeClause
@@ -1160,6 +1161,10 @@ PLA
: P L A
;
+LZ4
+ : L Z '4'
+ ;
+
LATEST
: L A T E S T
;
diff --git a/docs/SystemDesign/TsFile/Format.md
b/docs/SystemDesign/TsFile/Format.md
index c8fccf2..e6b5fb7 100644
--- a/docs/SystemDesign/TsFile/Format.md
+++ b/docs/SystemDesign/TsFile/Format.md
@@ -55,6 +55,7 @@
- **Compressing Type Hardcode**
- 0: UNCOMPRESSED
- 1: SNAPPY
+ - 7: LZ4
- **TsDigest Statistics Type Hardcode**
- 0: min_value
- 1: max_value
diff --git a/docs/UserGuide/Concept/Compression.md
b/docs/UserGuide/Concept/Compression.md
index de67acd..bab0442 100644
--- a/docs/UserGuide/Concept/Compression.md
+++ b/docs/UserGuide/Concept/Compression.md
@@ -23,10 +23,12 @@
When the time series is written and encoded as binary data according to the
specified type, IoTDB compresses the data using compression technology to
further improve space storage efficiency. Although both encoding and
compression are designed to improve storage efficiency, encoding techniques are
usually only available for specific data types (e.g., second-order differential
encoding is only suitable for INT32 or INT64 data type, and storing
floating-point numbers requires multiplying t [...]
-IoTDB allows you to specify the compression method of the column when creating
a time series, and now supports two compression methods:
+IoTDB allows you to specify the compression method of the column when creating
a time series, and now supports three compression methods:
* UNCOMPRESSED
* SNAPPY
+* LZ4
+
The specified syntax for compression is detailed in [Create Timeseries
Statement](../Operation%20Manual/SQL%20Reference.md).
diff --git a/docs/zh/SystemDesign/TsFile/Format.md
b/docs/zh/SystemDesign/TsFile/Format.md
index 308f222..0f5eb5c 100644
--- a/docs/zh/SystemDesign/TsFile/Format.md
+++ b/docs/zh/SystemDesign/TsFile/Format.md
@@ -54,6 +54,7 @@
- **压缩类型**
- 0: UNCOMPRESSED
- 1: SNAPPY
+ - 7: LZ4
- **预聚合信息**
- 0: min_value
- 1: max_value
diff --git a/docs/zh/UserGuide/Concept/Compression.md
b/docs/zh/UserGuide/Concept/Compression.md
index 1df449f..91103b6 100644
--- a/docs/zh/UserGuide/Concept/Compression.md
+++ b/docs/zh/UserGuide/Concept/Compression.md
@@ -23,9 +23,10 @@
当时间序列写入并按照指定的类型编码为二进制数据后,IoTDB会使用压缩技术对该数据进行压缩,进一步提升空间存储效率。虽然编码和压缩都旨在提升存储效率,但编码技术通常只适合特定的数据类型(如二阶差分编码只适合与INT32或者INT64编码,存储浮点数需要先将他们乘以10m以转换为整数),然后将它们转换为二进制流。压缩方式(SNAPPY)针对二进制流进行压缩,因此压缩方式的使用不再受数据类型的限制。
-IoTDB允许在创建一个时间序列的时候指定该列的压缩方式。现阶段IoTDB现在支持的压缩方式有两种:
+IoTDB允许在创建一个时间序列的时候指定该列的压缩方式。现阶段IoTDB现在支持的压缩方式有三种:
* UNCOMPRESSED(不压缩)
* SNAPPY压缩
+* LZ4压缩
压缩方式的指定语法详见本文[5.4节](../Operation%20Manual/SQL%20Reference.md)。
diff --git
a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
index 3e7a4e8..caccc35 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileConfig.java
@@ -134,8 +134,7 @@ public class TSFileConfig implements Serializable {
*/
private double dftSatisfyRate = 0.1;
/**
- * Data compression method, TsFile supports UNCOMPRESSED or SNAPPY. Default
- * value is UNCOMPRESSED which means no compression
+ * Data compression method, TsFile supports UNCOMPRESSED, SNAPPY or LZ4.
*/
private CompressionType compressor = CompressionType.SNAPPY;
/**