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 2021/03/04 17:16:09 UTC
[iotdb] branch NewDoc updated: doc format
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch NewDoc
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/NewDoc by this push:
new 95c2b6c doc format
95c2b6c is described below
commit 95c2b6cb5492041b4e61c8df74689d2b9e3806dc
Author: HTHou <hh...@outlook.com>
AuthorDate: Fri Mar 5 01:15:27 2021 +0800
doc format
---
docs/zh/UserGuide/Client/Command Line Interface.md | 24 +-
docs/zh/UserGuide/Client/Programming - JDBC.md | 15 +-
docs/zh/UserGuide/Client/Programming - MQTT.md | 45 ++-
.../UserGuide/Client/Programming - Native API.md | 225 +++++++-------
.../Client/Programming - Other Languages.md | 51 ++-
.../UserGuide/Client/Programming - TsFile API.md | 343 +++++++++++----------
docs/zh/UserGuide/Client/Status Codes.md | 4 +-
.../Concept/Data Model and Terminology.md | 10 +-
.../UserGuide/Ecosystem Integration/Hive TsFile.md | 4 -
.../Ecosystem Integration/MapReduce TsFile.md | 198 ++++++------
.../Get Started/Frequently asked questions.md | 18 +-
docs/zh/UserGuide/Get Started/QuickStart.md | 12 -
.../DDL Data Definition Language.md | 2 +-
.../DML Data Manipulation Language.md | 5 +-
docs/zh/UserGuide/Operation Manual/Kill Query.md | 2 +-
.../zh/UserGuide/Operation Manual/SQL Reference.md | 17 +-
.../Operation Manual/UDF User Defined Function.md | 6 +-
docs/zh/UserGuide/Server/Config Manual.md | 2 +-
.../System Tools/Monitor and Log Tools.md | 7 +-
.../System Tools/Performance Tracing Tool.md | 2 +-
20 files changed, 478 insertions(+), 514 deletions(-)
diff --git a/docs/zh/UserGuide/Client/Command Line Interface.md b/docs/zh/UserGuide/Client/Command Line Interface.md
index 4dd690f..5ab4f19 100644
--- a/docs/zh/UserGuide/Client/Command Line Interface.md
+++ b/docs/zh/UserGuide/Client/Command Line Interface.md
@@ -36,7 +36,7 @@ IOTDB为用户提供cli/Shell工具用于启动客户端和服务端程序。下
## 运行
-### Cli / Shell运行方式
+### Cli运行方式
安装后的IoTDB中有一个默认用户:`root`,默认密码为`root`。用户可以使用该用户尝试运行IoTDB客户端以测试服务器是否正常启动。客户端启动脚本为$IOTDB_HOME/bin文件夹下的`start-cli`脚本。启动脚本时需要指定运行IP和RPC PORT。以下为服务器在本机启动,且用户未更改运行端口号的示例,默认端口为6667。若用户尝试连接远程服务器或更改了服务器运行的端口号,请在-h和-p项处使用服务器的IP和RPC PORT。</br>
用户也可以在启动脚本的最前方设置自己的环境变量,如JAVA_HOME等 (对于linux用户,脚本路径为:"/sbin/start-cli.sh"; 对于windows用户,脚本路径为:"/sbin/start-cli.bat")
@@ -45,12 +45,12 @@ IOTDB为用户提供cli/Shell工具用于启动客户端和服务端程序。下
Linux系统与MacOS系统启动命令如下:
```
- Shell > sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
+Shell > sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
```
Windows系统启动命令如下:
```
- Shell > sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
+Shell > sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
```
回车后即可成功启动客户端。启动后出现如图提示即为启动成功。
@@ -64,11 +64,10 @@ Windows系统启动命令如下:
IoTDB> login successfully
-IoTDB>
```
输入`quit`或`exit`可退出cli结束本次会话,cli输出`quit normally`表示退出成功。
-### Cli / Shell运行参数
+### Cli运行参数
|参数名|参数类型|是否为必需参数| 说明| 例子 |
|:---|:---|:---|:---|:---|
@@ -87,12 +86,12 @@ IoTDB>
Linux系统与MacOS系统启动命令如下:
```
- Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
+Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
```
Windows系统启动命令如下:
```
- Shell > sbin\start-cli.bat -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
+Shell > sbin\start-cli.bat -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
```
### 使用OpenID作为用户名认证登录
@@ -102,7 +101,7 @@ Windows系统启动命令如下:
此时,登录命令如下:
```
- Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
+Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
```
其中,需要将{my-access-token} (注意,包括{})替换成你的token。
@@ -111,8 +110,7 @@ Windows系统启动命令如下:
并且你在keycloack中有一个被定义成publich的`iotdb`客户的realm,那么你可以使用如下`curl`命令获得token。
(注意例子中的{}和里面的内容需要替换成具体的服务器地址和realm名字):
```
-curl -X POST "https://{your-keycloack-server}/auth/realms/{your-realm}/protocol/openid-connect/token" \ ✔ 1613 11:09:38
- -H "Content-Type: application/x-www-form-urlencoded" \
+curl -X POST "https://{your-keycloack-server}/auth/realms/{your-realm}/protocol/openid-connect/token" \ -H "Content-Type: application/x-www-form-urlencoded" \
-d "username={username}" \
-d "password={password}" \
-d 'grant_type=password' \
@@ -125,7 +123,7 @@ curl -X POST "https://{your-keycloack-server}/auth/realms/{your-realm}/protocol/
{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJxMS1XbTBvelE1TzBtUUg4LVNKYXAyWmNONE1tdWNXd25RV0tZeFpKNG93In0.eyJleHAiOjE1OTAzOTgwNzEsImlhdCI6MTU5MDM5Nzc3MSwianRpIjoiNjA0ZmYxMDctN2NiNy00NTRmLWIwYmQtY2M2ZDQwMjFiNGU4IiwiaXNzIjoiaHR0cDovL2F1dGguZGVtby5wcmFnbWF0aWNpbmR1c3RyaWVzLmRlL2F1dGgvcmVhbG1zL0lvVERCIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImJhMzJlNDcxLWM3NzItNGIzMy04ZGE2LTZmZThhY2RhMDA3MyIsInR5cCI6IkJlYXJlciIsImF6cCI6ImlvdGRiIiwic2Vzc2lvbl9zdGF0ZSI6IjA2MGQyODYyLTE0ZWQtNDJmZS1 [...]
```
-### Cli / Shell的-e参数
+### Cli的批量操作
当您想要通过脚本的方式通过Cli / Shell对IoTDB进行批量操作时,可以使用-e参数。通过使用该参数,您可以在不进入客户端输入模式的情况下操作IoTDB。
为了避免SQL语句和其他参数混淆,现在只支持-e参数作为最后的参数使用。
@@ -135,12 +133,12 @@ curl -X POST "https://{your-keycloack-server}/auth/realms/{your-realm}/protocol/
Linux系统与MacOS指令:
```
- Shell > sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
+Shell > sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
```
Windows系统指令
```
- Shell > sbin\start-cli.bat -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
+Shell > sbin\start-cli.bat -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
```
在Windows环境下,-e参数的SQL语句需要使用` `` `对于`" "`进行替换
diff --git a/docs/zh/UserGuide/Client/Programming - JDBC.md b/docs/zh/UserGuide/Client/Programming - JDBC.md
index 018f1e3..6bea819 100644
--- a/docs/zh/UserGuide/Client/Programming - JDBC.md
+++ b/docs/zh/UserGuide/Client/Programming - JDBC.md
@@ -23,26 +23,19 @@
## JDBC
-### 依赖项
+### 依赖
* JDK >= 1.8
* Maven >= 3.6
-### 只打包 JDBC 工程
-
-在根目录下执行下面的命令:
-```
-mvn clean package -pl jdbc -am -Dmaven.test.skip=true
-```
-
-### 如何到本地 MAVEN 仓库
+### 安装方法
在根目录下执行下面的命令:
```
mvn clean install -pl jdbc -am -Dmaven.test.skip=true
```
-### 如何在 MAVEN 中使用 IoTDB JDBC
+### 在MAVEN中使用 IoTDB JDBC
```
<dependencies>
@@ -54,7 +47,7 @@ mvn clean install -pl jdbc -am -Dmaven.test.skip=true
</dependencies>
```
-### 示例
+### 示例代码
本章提供了如何建立数据库连接、执行 SQL 和显示查询结果的示例。
diff --git a/docs/zh/UserGuide/Client/Programming - MQTT.md b/docs/zh/UserGuide/Client/Programming - MQTT.md
index 89d8259..f7882f3 100644
--- a/docs/zh/UserGuide/Client/Programming - MQTT.md
+++ b/docs/zh/UserGuide/Client/Programming - MQTT.md
@@ -76,32 +76,31 @@ MQTT主题与IoTDB时间序列相对应。
| mqtt_payload_formatter | mqtt消息有效负载格式化程序 | json |
| mqtt_max_message_size | mqtt消息最大长度(字节)| 1048576 |
-### 例子
+### 示例代码
以下是mqtt客户端将消息发送到IoTDB服务器的示例。
```java
- MQTT mqtt = new MQTT();
- mqtt.setHost("127.0.0.1", 1883);
- mqtt.setUserName("root");
- mqtt.setPassword("root");
-
- BlockingConnection connection = mqtt.blockingConnection();
- connection.connect();
-
- Random random = new Random();
- for (int i = 0; i < 10; i++) {
- String payload = String.format("{\n" +
- "\"device\":\"root.sg.d1\",\n" +
- "\"timestamp\":%d,\n" +
- "\"measurements\":[\"s1\"],\n" +
- "\"values\":[%f]\n" +
- "}", System.currentTimeMillis(), random.nextDouble());
-
- connection.publish("root.sg.d1.s1", payload.getBytes(), QoS.AT_LEAST_ONCE, false);
- }
-
- connection.disconnect();
- }
+MQTT mqtt = new MQTT();
+mqtt.setHost("127.0.0.1", 1883);
+mqtt.setUserName("root");
+mqtt.setPassword("root");
+
+BlockingConnection connection = mqtt.blockingConnection();
+connection.connect();
+
+Random random = new Random();
+for (int i = 0; i < 10; i++) {
+ String payload = String.format("{\n" +
+ "\"device\":\"root.sg.d1\",\n" +
+ "\"timestamp\":%d,\n" +
+ "\"measurements\":[\"s1\"],\n" +
+ "\"values\":[%f]\n" +
+ "}", System.currentTimeMillis(), random.nextDouble());
+
+ connection.publish("root.sg.d1.s1", payload.getBytes(), QoS.AT_LEAST_ONCE, false);
+}
+
+connection.disconnect();
```
## Rest
diff --git a/docs/zh/UserGuide/Client/Programming - Native API.md b/docs/zh/UserGuide/Client/Programming - Native API.md
index fec8723..cfe1d88 100644
--- a/docs/zh/UserGuide/Client/Programming - Native API.md
+++ b/docs/zh/UserGuide/Client/Programming - Native API.md
@@ -26,12 +26,15 @@
* JDK >= 1.8
* Maven >= 3.6
-### 安装到本地 maven 库
+### 安装方法
在根目录下运行:
-> mvn clean install -pl session -am -Dmaven.test.skip=true
-### 在 maven 中使用原生接口
+```
+mvn clean install -pl session -am -Dmaven.test.skip=true
+```
+
+### 在MAVEN中使用原生接口
```
<dependencies>
@@ -43,183 +46,177 @@
</dependencies>
```
-### 原生接口使用示例
+### 原生接口说明
下面将给出Session对应的接口的简要介绍和对应参数:
* 初始化Session
- ```
- Session(String host, int rpcPort)
- Session(String host, String rpcPort, String username, String password)
- Session(String host, int rpcPort, String username, String password)
- ```
+```
+Session(String host, int rpcPort)
+Session(String host, String rpcPort, String username, String password)
+Session(String host, int rpcPort, String username, String password)
+```
* 开启Session
- ```
- Session.open()
- ```
+```
+Session.open()
+```
* 关闭Session
-
- ```
- Session.close()
- ```
+
+```
+Session.close()
+```
* 设置存储组
- ```
- void setStorageGroup(String storageGroupId)
- ```
+```
+void setStorageGroup(String storageGroupId)
+```
* 删除单个或多个存储组
- ```
- void deleteStorageGroup(String storageGroup)
- void deleteStorageGroups(List<String> storageGroups)
- ```
+```
+void deleteStorageGroup(String storageGroup)
+void deleteStorageGroups(List<String> storageGroups)
+```
* 创建单个或多个时间序列
- ```
- void createTimeseries(String path, TSDataType dataType,
- TSEncoding encoding, CompressionType compressor, Map<String, String> props,
- Map<String, String> tags, Map<String, String> attributes, String measurementAlias)
-
- void createMultiTimeseries(List<String> paths, List<TSDataType> dataTypes,
- List<TSEncoding> encodings, List<CompressionType> compressors,
- List<Map<String, String>> propsList, List<Map<String, String>> tagsList,
- List<Map<String, String>> attributesList, List<String> measurementAliasList)
- ```
+```
+void createTimeseries(String path, TSDataType dataType,
+ TSEncoding encoding, CompressionType compressor, Map<String, String> props,
+ Map<String, String> tags, Map<String, String> attributes, String measurementAlias)
+
+void createMultiTimeseries(List<String> paths, List<TSDataType> dataTypes,
+ List<TSEncoding> encodings, List<CompressionType> compressors,
+ List<Map<String, String>> propsList, List<Map<String, String>> tagsList,
+ List<Map<String, String>> attributesList, List<String> measurementAliasList)
+```
* 删除一个或多个时间序列
- ```
- void deleteTimeseries(String path)
- void deleteTimeseries(List<String> paths)
- ```
+```
+void deleteTimeseries(String path)
+void deleteTimeseries(List<String> paths)
+```
* 删除一个或多个时间序列在某个时间点前的数据
- ```
- void deleteData(String path, long time)
- void deleteData(List<String> paths, long time)
- ```
+```
+void deleteData(String path, long time)
+void deleteData(List<String> paths, long time)
+```
* 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。服务器需要做类型推断,可能会有额外耗时
- ```
- void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)
- ```
+```
+void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)
+```
* 插入一个 Tablet,Tablet 是一个设备若干行非空数据块,每一行的列都相同
- ```
- void insertTablet(Tablet tablet)
- ```
+```
+void insertTablet(Tablet tablet)
+```
* 插入多个 Tablet
- ```
- void insertTablets(Map<String, Tablet> tablet)
- ```
+```
+void insertTablets(Map<String, Tablet> tablet)
+```
* 插入多个 Record。服务器需要做类型推断,可能会有额外耗时
- ```
- void insertRecords(List<String> deviceIds, List<Long> times,
- List<List<String>> measurementsList, List<List<String>> valuesList)
- ```
+```
+void insertRecords(List<String> deviceIds, List<Long> times,
+ List<List<String>> measurementsList, List<List<String>> valuesList)
+```
* 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。提供数据类型后,服务器不需要做类型推断,可以提高性能
- ```
- void insertRecord(String deviceId, long time, List<String> measurements,
- List<TSDataType> types, List<Object> values)
- ```
+```
+void insertRecord(String deviceId, long time, List<String> measurements,
+ List<TSDataType> types, List<Object> values)
+```
* 插入多个 Record。提供数据类型后,服务器不需要做类型推断,可以提高性能
- ```
- void insertRecords(List<String> deviceIds, List<Long> times,
- List<List<String>> measurementsList, List<List<TSDataType>> typesList,
- List<List<Object>> valuesList)
- ```
+```
+void insertRecords(List<String> deviceIds, List<Long> times,
+ List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+ List<List<Object>> valuesList)
+```
* 插入同属于一个device的多个 Record。
- ```
- void insertRecordsOfOneDevice(String deviceId, List<Long> times,
- List<List<String>> measurementsList, List<List<TSDataType>> typesList,
- List<List<Object>> valuesList)
- ```
+```
+void insertRecordsOfOneDevice(String deviceId, List<Long> times,
+ List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+ List<List<Object>> valuesList)
+```
* 原始数据查询。时间间隔包含开始时间,不包含结束时间
- ```
- SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long endTime)
- ```
+```
+SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long endTime)
+```
* 执行查询语句
- ```
- SessionDataSet executeQueryStatement(String sql)
- ```
+```
+SessionDataSet executeQueryStatement(String sql)
+```
* 执行非查询语句
- ```
- void executeNonQueryStatement(String sql)
- ```
+```
+void executeNonQueryStatement(String sql)
+```
-### 测试客户端逻辑+网络传输代价的接口
+### 测试接口说明
* 测试 testInsertRecords,不实际写入数据,只将数据传输到 server 即返回。
- ```
- void testInsertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<String>> valuesList)
- ```
+```
+void testInsertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<String>> valuesList)
+```
或
- or
- ```
- void testInsertRecords(List<String> deviceIds, List<Long> times,
- List<List<String>> measurementsList, List<List<TSDataType>> typesList,
- List<List<Object>> valuesList)
- ```
+
+```
+void testInsertRecords(List<String> deviceIds, List<Long> times,
+ List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+ List<List<Object>> valuesList)
+```
* 测试 testInsertRecordsOfOneDevice,不实际写入数据,只将数据传输到 server 即返回。
- ```
- void testInsertRecordsOfOneDevice(List<String> deviceIds, List<Long> times,
- List<List<String>> measurementsList, List<List<TSDataType>> typesList,
- List<List<Object>> valuesList)
- ```
+```
+void testInsertRecordsOfOneDevice(List<String> deviceIds, List<Long> times,
+ List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+ List<List<Object>> valuesList)
+```
* 测试 insertRecord,不实际写入数据,只将数据传输到 server 即返回。
- ```
- void testInsertRecord(String deviceId, long time, List<String> measurements, List<String> values)
- ```
+```
+void testInsertRecord(String deviceId, long time, List<String> measurements, List<String> values)
+```
或
- ```
- void testInsertRecord(String deviceId, long time, List<String> measurements,
- List<TSDataType> types, List<Object> values)
- ```
+
+```
+void testInsertRecord(String deviceId, long time, List<String> measurements,
+ List<TSDataType> types, List<Object> values)
+```
* 测试 insertTablet,不实际写入数据,只将数据传输到 server 即返回。
- ```
- void testInsertTablet(Tablet tablet)
- ```
-
-
-### 示例代码
-
-浏览上述接口的详细信息,请参阅代码 ```session/src/main/java/org/apache/iotdb/session/Session.java```
-
-使用上述接口的示例代码在 ```example/session/src/main/java/org/apache/iotdb/SessionExample.java```
+```
+void testInsertTablet(Tablet tablet)
+```
### 针对原生接口的连接池
@@ -236,6 +233,14 @@
3. 若对一个查询的结果集遍历时出现异常,也需要手动调用释放连接的操作`closeResultSet`.
4. 可以调用 `SessionDataSetWrapper` 的 `getColumnNames()` 方法得到结果集列名
-使用示例可以参见 ```session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java```
+使用示例可以参见 `session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java`
或 `example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java`
+
+
+### 示例代码
+
+浏览上述接口的详细信息,请参阅代码 ```session/src/main/java/org/apache/iotdb/session/Session.java```
+
+使用上述接口的示例代码在 ```example/session/src/main/java/org/apache/iotdb/SessionExample.java```
+
diff --git a/docs/zh/UserGuide/Client/Programming - Other Languages.md b/docs/zh/UserGuide/Client/Programming - Other Languages.md
index 21981ea..abbfa01 100644
--- a/docs/zh/UserGuide/Client/Programming - Other Languages.md
+++ b/docs/zh/UserGuide/Client/Programming - Other Languages.md
@@ -22,10 +22,6 @@
## Python 原生接口
-### 介绍
-
-这是一个如何使用thrift rpc接口通过python连接到IoTDB的示例。 在Linux或Windows上情况会有所不同,我们将介绍如何分别在两个系统上进行操作。
-
### 依赖
首选python3.7或更高版本。
@@ -38,7 +34,7 @@
http://thrift.apache.org/docs/install/
```
-### 如何获取Python库
+### 安装方法
* 方案1: pip install
@@ -62,15 +58,12 @@ pip install apache-iotdb
### 示例代码
-我们在`client-py / src/ client_example.py`中提供了一个示例,说明如何使用Thrift库连接到IoTDB,请先仔细阅读,然后再编写自己的代码。
+我们在`client-py/src/client_example.py`中提供了一个示例,说明如何使用Thrift库连接到IoTDB,请先仔细阅读,然后再编写自己的代码。
## C++ 原生接口
-编译C++客户端之前首先需要本地编译Thrift库,compile-tools模块负责编译Thrift,之后再编译client-cpp。
-
-### Thrift编译依赖
-
+### 依赖
- Java 8+
- Maven 3.5+
- Flex
@@ -78,9 +71,13 @@ pip install apache-iotdb
- Boost
- OpenSSL 1.0+
+编译C++客户端之前首先需要本地编译Thrift库,compile-tools模块负责编译Thrift,之后再编译client-cpp。
+
+### 安装方法
+编译C++客户端之前首先需要本地编译Thrift库,compile-tools模块负责编译Thrift,之后再编译client-cpp。
-#### Mac
+#### 在Mac上编译Thrift
- Bison
@@ -122,7 +119,7 @@ brew link boost
-#### Linux
+#### 在Linux上编译Thrift
Linux下需要确保g++已被安装。
@@ -142,7 +139,7 @@ yum install gcc g++ bison flex boost-devel
-#### Windows
+#### 在Windows上编译Thrift
保证你的Windows系统已经搭建好了完整的C/C++的编译构建环境。可以是MSVC,MinGW等。
@@ -214,14 +211,14 @@ CMake需要根据不同编译平台使用不同的生成器。CMake支持的生
-### 编译C++ 客户端
+#### 编译C++ 客户端
Maven 命令中添加"-P client-cpp" 选项编译client-cpp模块。client-cpp需要依赖编译好的thrift,即compile-tools模块。
-#### 编译及测试:
+#### 编译及测试
完整的C++客户端命令如下:
@@ -264,15 +261,15 @@ mvn integration-test -P client-cpp -pl client-cpp,server,example/client-cpp-exam
-### FAQ
+### Q&A
-#### Mac
+#### Mac相关问题
本地Maven编译Thrift时如出现以下链接的问题,可以尝试将xcode-commandline版本从12降低到11.5
https://stackoverflow.com/questions/63592445/ld-unsupported-tapi-file-type-tapi-tbd-in-yaml-file/65518087#65518087
-#### Windows
+#### Windows相关问题
Maven编译Thrift时需要使用wget下载远端文件,可能出现以下报错:
@@ -289,23 +286,19 @@ Failed to delete cached file C:\Users\Administrator\.m2\repository\.cache\downlo
## Go 原生接口
-### 环境准备
-
-#### 操作系统
-
- * Linux、Macos或其他类unix系统
- * Windows+bash(WSL、cygwin、Git Bash)
-
-#### 命令行工具
+### 依赖
* golang >= 1.13
* make >= 3.0
* curl >= 7.1.1
* thrift 0.13.x
+ * Linux、Macos或其他类unix系统
+ * Windows+bash(WSL、cygwin、Git Bash)
+
-### 如何使用 (快速上手)
+### 安装方法
-使用go mod
+ * 通过go mod
```sh
export GO111MODULE=on
@@ -319,7 +312,7 @@ go mod init session_example
go run session_example.go
```
-不使用go mod,采用GOPATH
+* 通过GOPATH
```sh
# get thrift 0.13.0
diff --git a/docs/zh/UserGuide/Client/Programming - TsFile API.md b/docs/zh/UserGuide/Client/Programming - TsFile API.md
index 0280f07..d39ef23 100644
--- a/docs/zh/UserGuide/Client/Programming - TsFile API.md
+++ b/docs/zh/UserGuide/Client/Programming - TsFile API.md
@@ -28,74 +28,74 @@ TsFile 是在 IoTDB 中使用的时间序列的文件格式。在这个章节中
在您自己的项目中有两种方法使用 TsFile .
-* 使用 jar 包:
- * 编译源码生成 jar 包
+* 使用 jar 包: 编译源码生成 jar 包
- ```
- git clone https://github.com/apache/iotdb.git
- cd tsfile/
- mvn clean package -Dmaven.test.skip=true
- ```
- 命令执行完成之后,所有的 jar 包都可以从 `target/` 目录下找到。之后您可以在自己的工程中倒入 `target/tsfile-0.10.0-jar-with-dependencies.jar`.
+```
+git clone https://github.com/apache/iotdb.git
+cd tsfile/
+mvn clean package -Dmaven.test.skip=true
+```
+
+命令执行完成之后,所有的 jar 包都可以从 `target/` 目录下找到。之后您可以在自己的工程中倒入 `target/tsfile-0.10.0-jar-with-dependencies.jar`.
* 使用 Maven 依赖:
- 编译源码并且部署到您的本地仓库中需要 3 步:
+编译源码并且部署到您的本地仓库中需要 3 步:
- * 下载源码
+ 1. 下载源码
- ```
- git clone https://github.com/apache/iotdb.git
- ```
- * 编译源码和部署到本地仓库
+ ```
+git clone https://github.com/apache/iotdb.git
+```
+ 2. 编译源码和部署到本地仓库
- ```
- cd tsfile/
- mvn clean install -Dmaven.test.skip=true
- ```
- * 在您自己的工程中增加依赖:
-
- ```
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>tsfile</artifactId>
- <version>0.10.0</version>
- </dependency>
- ```
+ ```
+cd tsfile/
+mvn clean install -Dmaven.test.skip=true
+```
+ 3. 在您自己的工程中增加依赖:
+
+ ```
+ <dependency>
+ <groupId>org.apache.iotdb</groupId>
+ <artifactId>tsfile</artifactId>
+ <version>0.10.0</version>
+ </dependency>
+ ```
+或者,您可以直接使用官方的 Maven 仓库:
- 或者,您可以直接使用官方的 Maven 仓库:
-
- * 首先,在`${username}\.m2\settings.xml`目录下的`settings.xml`文件中`<profiles>`
+ 1. 首先,在`${username}\.m2\settings.xml`目录下的`settings.xml`文件中`<profiles>`
节中增加`<profile>`,内容如下:
- ```
- <profile>
- <id>allow-snapshots</id>
- <activation><activeByDefault>true</activeByDefault></activation>
- <repositories>
- <repository>
- <id>apache.snapshots</id>
- <name>Apache Development Snapshot Repository</name>
- <url>https://repository.apache.org/content/repositories/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- </profile>
- ```
- * 之后您可以在您的工程中增加如下依赖:
+
+ ```
+<profile>
+ <id>allow-snapshots</id>
+ <activation><activeByDefault>true</activeByDefault></activation>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Development Snapshot Repository</name>
+ <url>https://repository.apache.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ </profile>
+```
+ 2. 之后您可以在您的工程中增加如下依赖:
- ```
- <dependency>
- <groupId>org.apache.iotdb</groupId>
- <artifactId>tsfile</artifactId>
- <version>0.10.0</version>
- </dependency>
- ```
+ ```
+ <dependency>
+ <groupId>org.apache.iotdb</groupId>
+ <artifactId>tsfile</artifactId>
+ <version>0.10.0</version>
+ </dependency>
+ ```
### TsFile 的使用
本章节演示TsFile的详细用法。
@@ -132,15 +132,17 @@ device_1, 1490860659000, m1, 10, m2, 12.12
TsFile可以通过以下三个步骤生成,完整的代码参见"写入 TsFile 示例"章节。
-* 首先,构造一个`TsFileWriter`实例。
+1. 构造一个`TsFileWriter`实例。
以下是可用的构造函数:
* 没有预定义 schema
+
```
public TsFileWriter(File file) throws IOException
```
* 预定义 schema
+
```
public TsFileWriter(File file, Schema schema) throws IOException
```
@@ -165,18 +167,17 @@ TsFile可以通过以下三个步骤生成,完整的代码参见"写入 TsFile
**参数:**
* file : 写入 TsFile 数据的文件
-
* schema : 文件的 schemas,将在下章进行介绍
-
* config : TsFile 的一些配置项
-* 第二步,添加测量值(measurement)
+2. 添加测量值(measurement)
你也可以先创建一个`Schema`类的实例然后把它传递给`TsFileWriter`类的构造函数
`Schema`类保存的是一个映射关系,key 是一个 measurement 的名字,value 是 measurement schema.
下面是一系列接口:
+
```
// Create an empty Schema or from an existing map
public Schema()
@@ -198,6 +199,7 @@ TsFile可以通过以下三个步骤生成,完整的代码参见"写入 TsFile
```
`MeasurementSchema`类保存了一个测量(measurement)的信息,有几个构造函数:
+
```
public MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding)
public MeasurementSchema(String measurementId, TSDataType type, TSEncoding encoding, CompressionType compressionType)
@@ -220,13 +222,14 @@ TsFile可以通过以下三个步骤生成,完整的代码参见"写入 TsFile
> **注意:** 虽然一个测量(measurement)的名字可以被用在多个deltaObjects中, 但是它的参数是不允许被修改的。比如:
不允许多次为同一个测量(measurement)名添加不同类型的编码。下面是一个错误示例:
-
- // The measurement "sensor_1" is float type
- addMeasurement(new MeasurementSchema("sensor_1", TSDataType.FLOAT, TSEncoding.RLE));
- // This call will throw a WriteProcessException exception
- addMeasurement(new MeasurementSchema("sensor_1", TSDataType.INT32, TSEncoding.RLE));
-* 第三,插入和写入数据。
+ ```
+ // The measurement "sensor_1" is float type
+ addMeasurement(new MeasurementSchema("sensor_1", TSDataType.FLOAT, TSEncoding.RLE));
+ // This call will throw a WriteProcessException exception
+ addMeasurement(new MeasurementSchema("sensor_1", TSDataType.INT32, TSEncoding.RLE));
+ ```
+3. 插入和写入数据。
使用这个接口创建一个新的`TSRecord`(时间戳和设备对)。
@@ -237,30 +240,32 @@ TsFile可以通过以下三个步骤生成,完整的代码参见"写入 TsFile
然后创建一个`DataPoint`(度量(measurement)和值的对应),并使用 addTuple 方法将数据 DataPoint 添加正确的值到 TsRecord。
用下面这种方法写
+
```
public void write(TSRecord record) throws IOException, WriteProcessException
```
-* 最后,调用`close`方法来完成写入过程。
-
+4. 调用`close`方法来完成写入过程。
+
```
public void close() throws IOException
```
+
我们也支持将数据写入已关闭的 TsFile 文件中。
-* 使用`ForceAppendTsFileWriter`打开已经关闭的文件。
+1. 使用`ForceAppendTsFileWriter`打开已经关闭的文件。
-```
-public ForceAppendTsFileWriter(File file) throws IOException
-```
-* 调用 `doTruncate` 去掉文件的Metadata部分
+ ```
+ public ForceAppendTsFileWriter(File file) throws IOException
+ ```
+2. 调用 `doTruncate` 去掉文件的Metadata部分
-* 然后使用 `ForceAppendTsFileWriter` 构造另一个`TsFileWriter`
+3. 使用 `ForceAppendTsFileWriter` 构造另一个`TsFileWriter`
-```
-public TsFileWriter(TsFileIOWriter fileWriter) throws IOException
-```
+ ```
+ public TsFileWriter(TsFileIOWriter fileWriter) throws IOException
+ ```
请注意 此时需要重新添加测量值(measurement) 再进行上述写入操作。
#### 写入 TsFile 示例
@@ -273,18 +278,26 @@ mvn clean install -pl tsfile -am -DskipTests
如果存在**非对齐**的时序数据(比如:不是所有的传感器都有值),您可以通过构造**TSRecord**来写入。
-更详细的例子可以在`/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java`中查看
+更详细的例子可以在
+
+```
+/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTSRecord.java
+```
+
+中查看
如果所有时序数据都是**对齐**的,您可以通过构造**Tablet**来写入数据。
更详细的例子可以在
+
```
/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileWriteWithTablet.java
```
中查看
在已关闭的TsFile 文件中写入新数据的详细例子可以在
+
```
/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileForceAppendWrite.java
```
@@ -299,8 +312,8 @@ mvn clean install -pl tsfile -am -DskipTests
最后一部分"sensor_1"称为"measurementId",其余部分"root.area_1.device_1"称为deviceId。
正如之前提到的,不同设备中的相同测量(measurement)具有相同的数据类型和编码,设备也是唯一的。
-在read接口中,参数```paths```表示要选择的测量值(measurement)。
-Path实例可以很容易地通过类```Path```来构造。例如:
+在read接口中,参数`paths`表示要选择的测量值(measurement)。
+Path实例可以很容易地通过类`Path`来构造。例如:
```
Path p = new Path("device_1.sensor_1");
@@ -331,28 +344,31 @@ paths.add(new Path("device_1.sensor_3"));
有两种类型的过滤器。
* TimeFilter: 使用时序数据中的`time`过滤。
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter);
- ```
-使用以下关系获得一个`TimeFilter`对象(值是一个 long 型变量)。
-
- |Relationship|Description|
- |----|----|
- |TimeFilter.eq(value)|选择时间等于值的数据|
- |TimeFilter.lt(value)|选择时间小于值的数据|
- |TimeFilter.gt(value)|选择时间大于值的数据|
- |TimeFilter.ltEq(value)|选择时间小于等于值的数据|
- |TimeFilter.gtEq(value)|选择时间大于等于值的数据|
- |TimeFilter.notEq(value)|选择时间不等于值的数据|
- |TimeFilter.not(TimeFilter)|选择时间不满足另一个时间过滤器的数据|
+
+ ```
+ IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter);
+ ```
+
+ 使用以下关系获得一个`TimeFilter`对象(值是一个 long 型变量)。
+
+ |Relationship|Description|
+ |----|----|
+ |TimeFilter.eq(value)|选择时间等于值的数据|
+ |TimeFilter.lt(value)|选择时间小于值的数据|
+ |TimeFilter.gt(value)|选择时间大于值的数据|
+ |TimeFilter.ltEq(value)|选择时间小于等于值的数据|
+ |TimeFilter.gtEq(value)|选择时间大于等于值的数据|
+ |TimeFilter.notEq(value)|选择时间不等于值的数据|
+ |TimeFilter.not(TimeFilter)|选择时间不满足另一个时间过滤器的数据|
- * ValueFilter: 使用时序数据中的`value`过滤。
+ * ValueFilter: 使用时序数据中的`value`过滤。
- ```
- IExpression valueFilterExpr = new SingleSeriesExpression(Path, ValueFilter);
- ```
- `ValueFilter`的用法与`TimeFilter`相同,只是需要确保值的类型等于measurement(在路径中定义)的类型。
+ ```
+ IExpression valueFilterExpr = new SingleSeriesExpression(Path, ValueFilter);
+ ```
+
+ `ValueFilter`的用法与`TimeFilter`相同,只是需要确保值的类型等于measurement(在路径中定义)的类型。
* **Binary Filter Operators**
@@ -366,42 +382,41 @@ Filter Expression 示例
* **TimeFilterExpression 示例**
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.eq(15)); // series time = 15
+```
+IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.eq(15)); // series time = 15
- ```
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.ltEq(15)); // series time <= 15
+```
+```
+IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.ltEq(15)); // series time <= 15
- ```
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.lt(15)); // series time < 15
+```
+```
+IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.lt(15)); // series time < 15
- ```
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.gtEq(15)); // series time >= 15
+```
+```
+IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.gtEq(15)); // series time >= 15
- ```
- ```
- IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.notEq(15)); // series time != 15
+```
+```
+IExpression timeFilterExpr = new GlobalTimeExpression(TimeFilter.notEq(15)); // series time != 15
- ```
- ```
- IExpression timeFilterExpr = BinaryExpression.and(new GlobalTimeExpression(TimeFilter.gtEq(15L)),
- new GlobalTimeExpression(TimeFilter.lt(25L))); // 15 <= series time < 25
- ```
- ```
- IExpression timeFilterExpr = BinaryExpression.or(new GlobalTimeExpression(TimeFilter.gtEq(15L)),
- new GlobalTimeExpression(TimeFilter.lt(25L))); // series time >= 15 or series time < 25
- ```
+```
+```
+IExpression timeFilterExpr = BinaryExpression.and(new GlobalTimeExpression(TimeFilter.gtEq(15L)),
+ new GlobalTimeExpression(TimeFilter.lt(25L))); // 15 <= series time < 25
+```
+```
+IExpression timeFilterExpr = BinaryExpression.or(new GlobalTimeExpression(TimeFilter.gtEq(15L)),
+ new GlobalTimeExpression(TimeFilter.lt(25L))); // series time >= 15 or series time < 25
+```
-#### 读取接口
+* 读取接口
首先,我们打开 TsFile 并从文件路径`path`中获取一个`ReadOnlyTsFile`实例。
```
TsFileSequenceReader reader = new TsFileSequenceReader(path);
-
ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader);
```
接下来,我们准备路径数组和查询表达式,然后通过这个接口得到最终的`QueryExpression`对象:
@@ -412,68 +427,54 @@ QueryExpression queryExpression = QueryExpression.create(paths, statement);
ReadOnlyTsFile类有两个`query`方法来执行查询。
-* **Method 1**
-
- ```
- public QueryDataSet query(QueryExpression queryExpression) throws IOException
- ```
-
-* **Method 2**
+```
+public QueryDataSet query(QueryExpression queryExpression) throws IOException
+public QueryDataSet query(QueryExpression queryExpression, long partitionStartOffset, long partitionEndOffset) throws IOException
+```
- ```
- public QueryDataSet query(QueryExpression queryExpression, long partitionStartOffset, long partitionEndOffset) throws IOException
- ```
+此方法是为高级应用(如 TsFile-Spark 连接器)设计的。
- 此方法是为高级应用(如 TsFile-Spark 连接器)设计的。
+* **参数** : 对于第二个方法,添加了两个额外的参数来支持部分查询(Partial Query):
+ * `partitionStartOffset`: TsFile 的开始偏移量
+ * `partitionEndOffset`: TsFile 的结束偏移量
+
+>什么是部分查询?
- * **参数** : 对于 method 2,添加了两个额外的参数来支持部分查询(Partial Query):
- * ```partitionStartOffset```: TsFile 的开始偏移量
- * ```partitionEndOffset```: TsFile 的结束偏移量
-
- > **什么是部分查询?**
- >
- > 在一些分布式文件系统中(比如:HDFS), 文件被分成几个部分,这些部分被称为"Blocks"并存储在不同的节点中。在涉及的每个节点上并行执行查询可以提高效率。因此需要部分查询(Partial Query)。部分查询(Partial Query)仅支持查询 TsFile 中被```QueryConstant.PARTITION_START_OFFSET```和```QueryConstant.PARTITION_END_OFFSET```分割的部分。
+> 在一些分布式文件系统中(比如:HDFS), 文件被分成几个部分,这些部分被称为"Blocks"并存储在不同的节点中。在涉及的每个节点上并行执行查询可以提高效率。因此需要部分查询(Partial Query)。部分查询(Partial Query)仅支持查询 TsFile 中被`QueryConstant.PARTITION_START_OFFSET`和`QueryConstant.PARTITION_END_OFFSET`分割的部分。
-#### QueryDataset 接口
+* QueryDataset 接口
-上面执行的查询将返回一个`QueryDataset`对象。
+ 上面执行的查询将返回一个`QueryDataset`对象。
-下面是一些用户常用的接口:
+ 以下是一些用户常用的接口:
+ * `bool hasNext();`
-* `bool hasNext();`
+ 如果该数据集仍然有数据,则返回true。
+ * `List<Path> getPaths()`
- 如果该数据集仍然有数据,则返回true。
-* `List<Path> getPaths()`
+ 获取这个数据集中的路径。
+ * `List<TSDataType> getDataTypes();`
- 获取这个数据集中的路径。
-* `List<TSDataType> getDataTypes();`
+ 获取数据类型。
- 获取数据类型。TSDataType 是一个 enum 类,其值如下:
-
- BOOLEAN,
- INT32,
- INT64,
- FLOAT,
- DOUBLE,
- TEXT;
- * `RowRecord next() throws IOException;`
+ * `RowRecord next() throws IOException;`
- 获取下一条记录。
+ 获取下一条记录。
- `RowRecord`类包含一个`long`类型的时间戳和一个`List<Field>`,用于不同传感器中的数据,我们可以使用两个getter方法来获取它们。
+ `RowRecord`类包含一个`long`类型的时间戳和一个`List<Field>`,用于不同传感器中的数据,我们可以使用两个getter方法来获取它们。
- ```
- long getTimestamp();
- List<Field> getFields();
- ```
+ ```
+ long getTimestamp();
+ List<Field> getFields();
+ ```
- 要从一个字段获取数据,请使用以下方法:
+ 要从一个字段获取数据,请使用以下方法:
- ```
- TSDataType getDataType();
- Object getObjectValue();
- ```
+ ```
+ TSDataType getDataType();
+ Object getObjectValue();
+ ```
#### 读取现有 TsFile 示例
diff --git a/docs/zh/UserGuide/Client/Status Codes.md b/docs/zh/UserGuide/Client/Status Codes.md
index ff1e9a0..916ab51 100644
--- a/docs/zh/UserGuide/Client/Status Codes.md
+++ b/docs/zh/UserGuide/Client/Status Codes.md
@@ -19,9 +19,9 @@
-->
-## 状态码
+# 附录3:状态码
-在最新版本中引入了**状态码**这一概念。例如,因为IoTDB需要在写入数据之前首先注册时间序列,一种可能的解决方案是:
+在0.10版本中引入了**状态码**这一概念。例如,因为IoTDB需要在写入数据之前首先注册时间序列,一种可能的解决方案是:
```
try {
diff --git a/docs/zh/UserGuide/Concept/Data Model and Terminology.md b/docs/zh/UserGuide/Concept/Data Model and Terminology.md
index 40df859..76b523e 100644
--- a/docs/zh/UserGuide/Concept/Data Model and Terminology.md
+++ b/docs/zh/UserGuide/Concept/Data Model and Terminology.md
@@ -19,15 +19,13 @@
-->
-# 数据模型与技术
+# 数据模型
-本节,我们以电力场景为例,说明如何在IoTDB中创建一个正确的数据模型。附件是一个样例数据文件,方便您练习IoTDB。
+本节,我们以电力场景为例,说明如何在IoTDB中创建一个正确的数据模型。
-附件下载: [IoTDB-SampleData.txt](https://github.com/thulab/iotdb/files/4438687/OtherMaterial-Sample.Data.txt)。
+根据属性层级,属性涵盖范围以及数据之间的从属关系,我们可将其数据模型表示为如图2.1所示的属性层级组织结构,即电力集团层-电厂层-设备层-传感器层。其中ROOT为根节点,传感器层的每一个节点为叶子节点。IoTDB的语法规定,ROOT节点到叶子节点的路径以“.”连接,以此完整路径命名IoTDB中的一个时间序列。例如,图2.1最左侧路径对应的时间序列名称为`ROOT.ln.wf01.wt01.status`。
-根据[数据](https://github.com/thulab/iotdb/files/4438687/OtherMaterial-Sample.Data.txt)的属性层级,属性涵盖范围以及数据之间的从属关系,我们可将其数据模型表示为如图2.1所示的属性层级组织结构,即电力集团层-电厂层-设备层-传感器层。其中ROOT为根节点,传感器层的每一个节点为叶子节点。IoTDB的语法规定,ROOT节点到叶子节点的路径以“.”连接,以此完整路径命名IoTDB中的一个时间序列。例如,图2.1最左侧路径对应的时间序列名称为`ROOT.ln.wf01.wt01.status`。
-
-<center><img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/13203019/51577327-7aa50780-1ef4-11e9-9d75-cadabb62444e.jpg"></center>
+<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/13203019/51577327-7aa50780-1ef4-11e9-9d75-cadabb62444e.jpg">
**图2.1 属性层级组织结构**
diff --git a/docs/zh/UserGuide/Ecosystem Integration/Hive TsFile.md b/docs/zh/UserGuide/Ecosystem Integration/Hive TsFile.md
index 06ca98f..834fcdb 100644
--- a/docs/zh/UserGuide/Ecosystem Integration/Hive TsFile.md
+++ b/docs/zh/UserGuide/Ecosystem Integration/Hive TsFile.md
@@ -39,7 +39,6 @@ TsFile的Hive连接器实现了对Hive读取外部Tsfile类型的文件格式的
|------------- |------------ | ------------ |------------ |
| `2.7.3` or `3.2.1` | `2.3.6` or `3.1.2` | `1.8` | `0.10.0`|
-> 注意:关于如何下载和使用Tsfile, 请参考以下链接: <https://github.com/apache/iotdb/tree/master/tsfile>。
### 数据类型对应关系
@@ -172,9 +171,6 @@ OK
Time taken: 11.334 seconds, Fetched: 1 row(s)
```
-### 后续工作
-
-我们现在仅支持查询操作,写操作的支持还在开发中...
## Flink-TsFile
diff --git a/docs/zh/UserGuide/Ecosystem Integration/MapReduce TsFile.md b/docs/zh/UserGuide/Ecosystem Integration/MapReduce TsFile.md
index 1a5b094..77a7230 100644
--- a/docs/zh/UserGuide/Ecosystem Integration/MapReduce TsFile.md
+++ b/docs/zh/UserGuide/Ecosystem Integration/MapReduce TsFile.md
@@ -19,24 +19,8 @@
-->
-# MapReduce TsFile
+## Hadoop-TsFile
-<!-- TOC -->
-## 概要
-
-- TsFile的Hadoop连接器使用手册
- - 什么是TsFile的Hadoop连接器
- - 系统环境要求
- - 数据类型对应关系
- - 关于TSFInputFormat的说明
- - 使用示例
- - 读示例: 求和
- - 写示例: 计算平均数并写入Tsfile中
-
-<!-- /TOC -->
-# TsFile的Hadoop连接器使用手册
-
-## 什么是TsFile的Hadoop连接器
TsFile的Hadoop连接器实现了对Hadoop读取外部Tsfile类型的文件格式的支持。让用户可以使用Hadoop的map、reduce等操作对Tsfile文件进行读取、写入和查询。
@@ -45,7 +29,7 @@ TsFile的Hadoop连接器实现了对Hadoop读取外部Tsfile类型的文件格
* 将某个特定目录下的所有文件加载进Hadoop,不论文件是存储在本地文件系统或者是HDFS中
* 将Hadoop处理完后的结果以Tsfile的格式保存
-## 系统环境要求
+### 系统环境要求
|Hadoop 版本 | Java 版本 | TsFile 版本 |
|------------- | ------------ |------------ |
@@ -53,7 +37,7 @@ TsFile的Hadoop连接器实现了对Hadoop读取外部Tsfile类型的文件格
>注意:关于如何下载和使用Tsfile, 请参考以下链接: https://github.com/apache/iotdb/tree/master/tsfile.
-## 数据类型对应关系
+### 数据类型对应关系
| TsFile 数据类型 | Hadoop writable |
| ---------------- | --------------- |
@@ -64,7 +48,7 @@ TsFile的Hadoop连接器实现了对Hadoop读取外部Tsfile类型的文件格
| DOUBLE | DoubleWritable |
| TEXT | Text |
-## 关于TSFInputFormat的说明
+### 关于TSFInputFormat的说明
TSFInputFormat继承了Hadoop中FileInputFormat类,重写了其中切片的方法。
@@ -92,66 +76,66 @@ TSFInputFormat将tsfile中的数据以多个`MapWritable`记录的形式返回
`mapwritable.get(new Text("s1"))`
> 注意: `MapWritable`中所有的键值类型都是`Text`。
-## 使用示例
+### 使用示例
-### 读示例: 求和
+#### 读示例: 求和
首先,我们需要在TSFInputFormat中配置我们需要哪些数据
```
- // configure reading time enable
- TSFInputFormat.setReadTime(job, true);
- // configure reading deviceId enable
- TSFInputFormat.setReadDeviceId(job, true);
- // configure reading which deltaObjectIds
- String[] deviceIds = {"device_1"};
- TSFInputFormat.setReadDeviceIds(job, deltaObjectIds);
- // configure reading which measurementIds
- String[] measurementIds = {"sensor_1", "sensor_2", "sensor_3"};
- TSFInputFormat.setReadMeasurementIds(job, measurementIds);
+// configure reading time enable
+TSFInputFormat.setReadTime(job, true);
+// configure reading deviceId enable
+TSFInputFormat.setReadDeviceId(job, true);
+// configure reading which deltaObjectIds
+String[] deviceIds = {"device_1"};
+TSFInputFormat.setReadDeviceIds(job, deltaObjectIds);
+// configure reading which measurementIds
+String[] measurementIds = {"sensor_1", "sensor_2", "sensor_3"};
+TSFInputFormat.setReadMeasurementIds(job, measurementIds);
```
然后,必须指定mapper和reducer输出的键和值类型
```
- // set inputformat and outputformat
- job.setInputFormatClass(TSFInputFormat.class);
- // set mapper output key and value
- job.setMapOutputKeyClass(Text.class);
- job.setMapOutputValueClass(DoubleWritable.class);
- // set reducer output key and value
- job.setOutputKeyClass(Text.class);
- job.setOutputValueClass(DoubleWritable.class);
+// set inputformat and outputformat
+job.setInputFormatClass(TSFInputFormat.class);
+// set mapper output key and value
+job.setMapOutputKeyClass(Text.class);
+job.setMapOutputValueClass(DoubleWritable.class);
+// set reducer output key and value
+job.setOutputKeyClass(Text.class);
+job.setOutputValueClass(DoubleWritable.class);
```
接着,就可以编写包含具体的处理数据逻辑的`mapper`和`reducer`类了。
```
- public static class TSMapper extends Mapper<NullWritable, MapWritable, Text, DoubleWritable> {
-
- @Override
- protected void map(NullWritable key, MapWritable value,
- Mapper<NullWritable, MapWritable, Text, DoubleWritable>.Context context)
- throws IOException, InterruptedException {
-
- Text deltaObjectId = (Text) value.get(new Text("device_id"));
- context.write(deltaObjectId, (DoubleWritable) value.get(new Text("sensor_3")));
- }
- }
-
- public static class TSReducer extends Reducer<Text, DoubleWritable, Text, DoubleWritable> {
+public static class TSMapper extends Mapper<NullWritable, MapWritable, Text, DoubleWritable> {
+
+ @Override
+ protected void map(NullWritable key, MapWritable value,
+ Mapper<NullWritable, MapWritable, Text, DoubleWritable>.Context context)
+ throws IOException, InterruptedException {
+
+ Text deltaObjectId = (Text) value.get(new Text("device_id"));
+ context.write(deltaObjectId, (DoubleWritable) value.get(new Text("sensor_3")));
+ }
+}
- @Override
- protected void reduce(Text key, Iterable<DoubleWritable> values,
- Reducer<Text, DoubleWritable, Text, DoubleWritable>.Context context)
- throws IOException, InterruptedException {
-
- double sum = 0;
- for (DoubleWritable value : values) {
- sum = sum + value.get();
- }
- context.write(key, new DoubleWritable(sum));
- }
- }
+public static class TSReducer extends Reducer<Text, DoubleWritable, Text, DoubleWritable> {
+
+ @Override
+ protected void reduce(Text key, Iterable<DoubleWritable> values,
+ Reducer<Text, DoubleWritable, Text, DoubleWritable>.Context context)
+ throws IOException, InterruptedException {
+
+ double sum = 0;
+ for (DoubleWritable value : values) {
+ sum = sum + value.get();
+ }
+ context.write(key, new DoubleWritable(sum));
+ }
+}
```
> 注意: 完整的代码示例可以在如下链接中找到:https://github.com/apache/iotdb/blob/master/example/hadoop/src/main/java/org/apache/iotdb/hadoop/tsfile/TSFMRReadExample.java
@@ -162,57 +146,57 @@ TSFInputFormat将tsfile中的数据以多个`MapWritable`记录的形式返回
除了`OutputFormatClass`,剩下的配置代码跟上面的读示例是一样的
```
- job.setOutputFormatClass(TSFOutputFormat.class);
- // set reducer output key and value
- job.setOutputKeyClass(NullWritable.class);
- job.setOutputValueClass(HDFSTSRecord.class);
+job.setOutputFormatClass(TSFOutputFormat.class);
+// set reducer output key and value
+job.setOutputKeyClass(NullWritable.class);
+job.setOutputValueClass(HDFSTSRecord.class);
```
然后,是包含具体的处理数据逻辑的`mapper`和`reducer`类。
```
- public static class TSMapper extends Mapper<NullWritable, MapWritable, Text, MapWritable> {
-
- @Override
- protected void map(NullWritable key, MapWritable value,
- Mapper<NullWritable, MapWritable, Text, MapWritable>.Context context)
- throws IOException, InterruptedException {
-
- Text deltaObjectId = (Text) value.get(new Text("device_id"));
- long timestamp = ((LongWritable)value.get(new Text("timestamp"))).get();
- if (timestamp % 100000 == 0) {
- context.write(deltaObjectId, new MapWritable(value));
- }
+public static class TSMapper extends Mapper<NullWritable, MapWritable, Text, MapWritable> {
+
+ @Override
+ protected void map(NullWritable key, MapWritable value,
+ Mapper<NullWritable, MapWritable, Text, MapWritable>.Context context)
+ throws IOException, InterruptedException {
+
+ Text deltaObjectId = (Text) value.get(new Text("device_id"));
+ long timestamp = ((LongWritable)value.get(new Text("timestamp"))).get();
+ if (timestamp % 100000 == 0) {
+ context.write(deltaObjectId, new MapWritable(value));
}
}
+}
+
+/**
+ * This reducer calculate the average value.
+ */
+public static class TSReducer extends Reducer<Text, MapWritable, NullWritable, HDFSTSRecord> {
- /**
- * This reducer calculate the average value.
- */
- public static class TSReducer extends Reducer<Text, MapWritable, NullWritable, HDFSTSRecord> {
-
- @Override
- protected void reduce(Text key, Iterable<MapWritable> values,
- Reducer<Text, MapWritable, NullWritable, HDFSTSRecord>.Context context) throws IOException, InterruptedException {
- long sensor1_value_sum = 0;
- long sensor2_value_sum = 0;
- double sensor3_value_sum = 0;
- long num = 0;
- for (MapWritable value : values) {
- num++;
- sensor1_value_sum += ((LongWritable)value.get(new Text("sensor_1"))).get();
- sensor2_value_sum += ((LongWritable)value.get(new Text("sensor_2"))).get();
- sensor3_value_sum += ((DoubleWritable)value.get(new Text("sensor_3"))).get();
- }
- HDFSTSRecord tsRecord = new HDFSTSRecord(1L, key.toString());
- DataPoint dPoint1 = new LongDataPoint("sensor_1", sensor1_value_sum / num);
- DataPoint dPoint2 = new LongDataPoint("sensor_2", sensor2_value_sum / num);
- DataPoint dPoint3 = new DoubleDataPoint("sensor_3", sensor3_value_sum / num);
- tsRecord.addTuple(dPoint1);
- tsRecord.addTuple(dPoint2);
- tsRecord.addTuple(dPoint3);
- context.write(NullWritable.get(), tsRecord);
+ @Override
+ protected void reduce(Text key, Iterable<MapWritable> values,
+ Reducer<Text, MapWritable, NullWritable, HDFSTSRecord>.Context context) throws IOException, InterruptedException {
+ long sensor1_value_sum = 0;
+ long sensor2_value_sum = 0;
+ double sensor3_value_sum = 0;
+ long num = 0;
+ for (MapWritable value : values) {
+ num++;
+ sensor1_value_sum += ((LongWritable)value.get(new Text("sensor_1"))).get();
+ sensor2_value_sum += ((LongWritable)value.get(new Text("sensor_2"))).get();
+ sensor3_value_sum += ((DoubleWritable)value.get(new Text("sensor_3"))).get();
}
+ HDFSTSRecord tsRecord = new HDFSTSRecord(1L, key.toString());
+ DataPoint dPoint1 = new LongDataPoint("sensor_1", sensor1_value_sum / num);
+ DataPoint dPoint2 = new LongDataPoint("sensor_2", sensor2_value_sum / num);
+ DataPoint dPoint3 = new DoubleDataPoint("sensor_3", sensor3_value_sum / num);
+ tsRecord.addTuple(dPoint1);
+ tsRecord.addTuple(dPoint2);
+ tsRecord.addTuple(dPoint3);
+ context.write(NullWritable.get(), tsRecord);
}
+}
```
> 注意: 完整的代码示例可以在如下链接中找到:https://github.com/apache/iotdb/blob/master/example/hadoop/src/main/java/org/apache/iotdb/hadoop/tsfile/TSMRWriteExample.java
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Get Started/Frequently asked questions.md b/docs/zh/UserGuide/Get Started/Frequently asked questions.md
index 1f3158d..13a3bac 100644
--- a/docs/zh/UserGuide/Get Started/Frequently asked questions.md
+++ b/docs/zh/UserGuide/Get Started/Frequently asked questions.md
@@ -23,8 +23,7 @@
# 常见问题
-
-## 如何查询我的 IoTDB 版本?
+**如何查询我的 IoTDB 版本**
有几种方法可以识别您使用的 IoTDB 版本:
@@ -66,7 +65,8 @@ Total line number = 1
It costs 0.241s
```
-## 在哪里可以找到 IoTDB 的日志?
+
+**在哪里可以找到 IoTDB 的日志**
假设您的根目录是:
@@ -88,11 +88,11 @@ Readme.md
在默认的设置里,logs 文件夹会被存储在```IOTDB_HOME/logs```。您可以在```IOTDB_HOME/conf```目录下的```logback.xml```文件中修改日志的级别和日志的存储路径。
-## 在哪里可以找到 IoTDB 的数据文件?
+**在哪里可以找到 IoTDB 的数据文件**
在默认的设置里,数据文件(包含 TsFile,metadata,WAL)被存储在```IOTDB_HOME/data```文件夹。
-## 如何知道 IoTDB 中存储了多少时间序列?
+**如何知道 IoTDB 中存储了多少时间序列**
使用 IoTDB 的命令行接口:
@@ -115,15 +115,15 @@ IoTDB> count timeseries root
> 6
```
-## 可以使用 Hadoop 和 Spark 读取 IoTDB 中的 TsFile 吗?
+**可以使用 Hadoop 和 Spark 读取 IoTDB 中的 TsFile 吗?**
是的。IoTDB 与开源生态紧密结合。IoTDB 支持 [Hadoop](https://github.com/apache/iotdb/tree/master/hadoop), [Spark](https://github.com/apache/iotdb/tree/master/spark) 和 [Grafana](https://github.com/apache/iotdb/tree/master/grafana) 可视化工具.
-## IoTDB如何处理重复的数据点?
+**IoTDB如何处理重复的数据点**
一个数据点是由一个完整的时间序列路径(例如:```root.vehicle.d0.s0```)和时间戳唯一标识的。如果您使用与现有点相同的路径和时间戳提交一个新点,那么IoTDB将更新这个点的值,而不是插入一个新点。
-## 我如何知道具体的 timeseries 的类型?
+**我如何知道具体的 timeseries 的类型**
在 IoTDB 的命令行接口中使用 SQL ```SHOW TIMESERIES <timeseries path>```:
@@ -145,7 +145,7 @@ IoTDB> show timeseries root.fit.d1.s1
IoTDB> show timeseries root.fit.d1.*
```
-## 如何更改IoTDB的客户端时间显示格式?
+**如何更改IoTDB的客户端时间显示格式**
IoTDB 客户端默认显示的时间是人类可读的(比如:```1970-01-01T08:00:00.001```),如果您想显示是时间戳或者其他可读格式, 请在启动命令上添加参数```-disableISO8601```:
diff --git a/docs/zh/UserGuide/Get Started/QuickStart.md b/docs/zh/UserGuide/Get Started/QuickStart.md
index ac5569f..de401f8 100644
--- a/docs/zh/UserGuide/Get Started/QuickStart.md
+++ b/docs/zh/UserGuide/Get Started/QuickStart.md
@@ -19,8 +19,6 @@
-->
-<!-- TOC -->
-
# 快速上手
@@ -263,16 +261,6 @@ Windows系统停止命令如下:
> $sbin\stop-server.bat
```
-### 只建立客户端
-
-在iotdb的根路径下:
-
-```
-> mvn clean package -pl cli -am -DskipTests
-```
-
-构建后,IoTDB客户端将位于文件夹“ cli / target / iotdb-cli- {project.version}”下。
-
## 基础配置
配置文件在"conf"文件夹下,包括:
diff --git a/docs/zh/UserGuide/Operation Manual/DDL Data Definition Language.md b/docs/zh/UserGuide/Operation Manual/DDL Data Definition Language.md
index f0f8184..49edb3c 100644
--- a/docs/zh/UserGuide/Operation Manual/DDL Data Definition Language.md
+++ b/docs/zh/UserGuide/Operation Manual/DDL Data Definition Language.md
@@ -238,7 +238,7 @@ It costs 0.004s
那么Metadata Tree如下所示:
-<center><img style="width:100%; max-width:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/19167280/69792176-1718f400-1201-11ea-861a-1a83c07ca144.jpg"></center>
+<img style="width:100%; max-width:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/19167280/69792176-1718f400-1201-11ea-861a-1a83c07ca144.jpg">
可以看到,`root`被定义为`LEVEL=0`。那么当你输入如下语句时:
diff --git a/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md b/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md
index 0d16cd3..dcbedb2 100644
--- a/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md
+++ b/docs/zh/UserGuide/Operation Manual/DML Data Manipulation Language.md
@@ -321,14 +321,13 @@ GROUP BY语句为用户提供三类指定参数:
* 参数2:划分时间轴的时间间隔参数(必须为正数)
* 参数3:滑动步长(可选参数,默认值与时间间隔相同,自定义的值必须大于等于时间间隔)
-三类参数的实际含义已经在图5.2中指出,这三类参数里,第三个参数是可选的。
+三类参数的实际含义已经在下图中指出,这三类参数里,第三个参数是可选的。
接下来,我们将给出三种典型的降频聚合查询的例子:
滑动步长未指定,
指定滑动步长,
带值过滤条件。
-<center><img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/16079446/69109512-f808bc80-0ab2-11ea-9e4d-b2b2f58fb474.png">
-**图 5.2 三类参数的实际含义**</center>
+<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/16079446/69109512-f808bc80-0ab2-11ea-9e4d-b2b2f58fb474.png">
* 未指定滑动步长的降频聚合查询
diff --git a/docs/zh/UserGuide/Operation Manual/Kill Query.md b/docs/zh/UserGuide/Operation Manual/Kill Query.md
index 31e4631..ae2eaae 100644
--- a/docs/zh/UserGuide/Operation Manual/Kill Query.md
+++ b/docs/zh/UserGuide/Operation Manual/Kill Query.md
@@ -49,7 +49,7 @@ IoTDB> FULL MERGE
IoTDB> CLEAR CACHE
```
-### 为 SCHEMA 创建快照
+### SCHEMA SNAPSHOT
为了加快 IoTDB 重启速度,用户可以手动触发创建 schema 的快照,从而避免服务器从 mlog 文件中恢复。
```
diff --git a/docs/zh/UserGuide/Operation Manual/SQL Reference.md b/docs/zh/UserGuide/Operation Manual/SQL Reference.md
index fcaf288..30d1b7d 100644
--- a/docs/zh/UserGuide/Operation Manual/SQL Reference.md
+++ b/docs/zh/UserGuide/Operation Manual/SQL Reference.md
@@ -19,7 +19,7 @@
-->
-# SQL 参考文档
+# 附录2: SQL 参考文档
## 显示版本号
@@ -104,6 +104,7 @@ Eg: IoTDB > DELETE TIMESERIES root.ln.wf01.wt01.*
```
* 修改时间序列标签属性语句
+
```
ALTER TIMESERIES fullPath alterClause
alterClause
@@ -149,6 +150,7 @@ Note: This statement can be used in IoTDB Client and JDBC.
```
* 显示满足条件的时间序列语句
+
```
SHOW TIMESERIES prefixPath? showWhereClause?
showWhereClause
@@ -285,6 +287,7 @@ Note: This statement can be used in IoTDB Client and JDBC.
```
* 为 schema 创建快照
+
```
CREATE SNAPSHOT FOR SCHEMA
```
@@ -859,6 +862,7 @@ Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = <T
* FIRST_VALUE
原有的 `FIRST` 方法在 `v0.10.0` 版本更名为 `FIRST_VALUE`。
+
```
SELECT FIRST_VALUE (Path) (COMMA FIRST_VALUE (Path))* FROM <FromClause> [WHERE <WhereClause>]?
Eg. SELECT FIRST_VALUE (status), FIRST_VALUE (temperature) FROM root.ln.wf01.wt01 WHERE root.ln.wf01.wt01.temperature < 24
@@ -891,6 +895,7 @@ Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = <T
* AVG
原有的 `MEAN` 方法在 `v0.9.0` 版本更名为 `AVG`。
+
```
SELECT AVG (Path) (COMMA AVG (Path))* FROM <FromClause> [WHERE <WhereClause>]?
Eg. SELECT AVG (temperature) FROM root.ln.wf01.wt01 WHERE root.ln.wf01.wt01.temperature < 24
@@ -939,6 +944,7 @@ IoTDB支持对存储组级别设置数据存活时间(TTL),这使得IoTDB
IoTDB中的TTL操作通可以由以下的语句进行实现:
* 设置 TTL
+
```
SET TTL TO StorageGroupName TTLTime
Eg. SET TTL TO root.group1 3600000
@@ -947,6 +953,7 @@ Eg. SET TTL TO root.group1 3600000
```
* 取消 TTL
+
```
UNSET TTL TO StorageGroupName
Eg. UNSET TTL TO root.group1
@@ -954,6 +961,7 @@ Eg. UNSET TTL TO root.group1
```
* 显示 TTL
+
```
SHOW ALL TTL
SHOW TTL ON StorageGroupNames
@@ -970,6 +978,7 @@ Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
对应的数据。因此我们不推荐您频繁修改TTL,除非您能接受该操作带来的一定程度的不可预知性。
* 删除时间分区 (实验性功能)
+
```
DELETE PARTITION StorageGroupName INT(COMMA INT)*
Eg DELETE PARTITION root.sg1 0,1,2
@@ -995,15 +1004,15 @@ SHOW QUERY PROCESSLIST
```
- 中止查询
+
```
KILL QUERY INT?
E.g. KILL QUERY
E.g. KILL QUERY 2
```
-# 参考
-## 标识符
+## 标识符列表
```
QUOTE := '\'';
@@ -1058,7 +1067,7 @@ eg. _abc123
```
-## 常量
+## 常量列表
```
diff --git a/docs/zh/UserGuide/Operation Manual/UDF User Defined Function.md b/docs/zh/UserGuide/Operation Manual/UDF User Defined Function.md
index 19caf1f..4b6e9f8 100644
--- a/docs/zh/UserGuide/Operation Manual/UDF User Defined Function.md
+++ b/docs/zh/UserGuide/Operation Manual/UDF User Defined Function.md
@@ -21,7 +21,7 @@
-# UDF (用户定义函数)
+# 用户定义函数(UDF)
UDF(User Defined Function)即用户自定义函数。IoTDB提供多种内建函数来满足您的计算需求,同时您还可以通过创建自定义函数来满足更多的计算需求。
@@ -29,7 +29,7 @@ UDF(User Defined Function)即用户自定义函数。IoTDB提供多种内建
-## UDF分类
+## UDF类型
IoTDB 支持两种类型的 UDF 函数,如下表所示。
@@ -189,7 +189,7 @@ void beforeStart(UDFParameters parameters, UDTFConfigurations configurations) th
3类参数的关系可见下图。策略的构造方法详见Javadoc。
-<div style="text-align: center;"><img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/30497621/99787878-47b51480-2b5b-11eb-8ed3-84088c5c30f7.png"></div>
+<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/30497621/99787878-47b51480-2b5b-11eb-8ed3-84088c5c30f7.png">
注意,最后的一些时间窗口的实际时间间隔可能小于规定的时间间隔参数。另外,可能存在某些时间窗口内数据行数量为0的情况,这种情况框架也会为该窗口调用一次`transform`方法。
diff --git a/docs/zh/UserGuide/Server/Config Manual.md b/docs/zh/UserGuide/Server/Config Manual.md
index 0b5cd53..d556392 100644
--- a/docs/zh/UserGuide/Server/Config Manual.md
+++ b/docs/zh/UserGuide/Server/Config Manual.md
@@ -19,7 +19,7 @@
-->
-# 配置手册
+# 附录1:配置参数
为方便IoTDB Server的配置与管理,IoTDB Server为用户提供三种配置项,使得用户可以在启动服务器或服务器运行时对其进行配置。
diff --git a/docs/zh/UserGuide/System Tools/Monitor and Log Tools.md b/docs/zh/UserGuide/System Tools/Monitor and Log Tools.md
index 91e2206..6cf5a71 100644
--- a/docs/zh/UserGuide/System Tools/Monitor and Log Tools.md
+++ b/docs/zh/UserGuide/System Tools/Monitor and Log Tools.md
@@ -27,7 +27,7 @@
#### 系统状态监控
-进入Jconsole监控页面后,首先看到的是IoTDB各类运行情况的概览。在这里,您可以看到[堆内存信息、线程信息、类信息以及服务器的CPU使用情况](https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html)。
+进入Jconsole监控页面后,首先看到的是IoTDB各类运行情况的概览。在这里,您可以看到堆内存信息、线程信息、类信息以及服务器的CPU使用情况。
#### JMX MBean监控
@@ -125,7 +125,7 @@ Monitor下有几个属性,包括数据文件目录,写入数据统计信息
<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/34242296/92922942-34a20c00-f469-11ea-8dc2-8229d454583c.png"> <br>
-##### 例子
+#### 示例
下面为您展示两个具体的例子。用户可以通过`SELECT`语句查询自己所需要的写入数据统计项。(查询方法与普通的时间序列查询方式一致)
@@ -142,6 +142,7 @@ select TOTAL_POINTS from root.stats."root.ln"
```
若您需要查询当前系统的最新信息,您可以使用最新数据查询,SQL语句如下:
+
```sql
flush
select last TOTAL_POINTS from root.stats."global"
@@ -170,7 +171,7 @@ select last TOTAL_POINTS from root.stats."global"
#### 利用JMX MBean动态调节参数
-通过端口31999连接jconsole,并在上方菜单项中选择‘MBean’. 展开侧边框并选择 'org.apache.iotdb.db.cost.statistic'. 将会得到如下图所示结果:
+通过端口31999连接jconsole,并在上方菜单项中选择`MBean`. 展开侧边框并选择 `org.apache.iotdb.db.cost.statistic`. 将会得到如下图所示结果:
<img style="width:100%; max-width:800px; max-height:600px; margin-left:auto; margin-right:auto; display:block;" src="https://user-images.githubusercontent.com/13203019/60937484-30c5a780-a303-11e9-8e92-04c413df2088.png">
diff --git a/docs/zh/UserGuide/System Tools/Performance Tracing Tool.md b/docs/zh/UserGuide/System Tools/Performance Tracing Tool.md
index 5c0ce31..81b3f75 100644
--- a/docs/zh/UserGuide/System Tools/Performance Tracing Tool.md
+++ b/docs/zh/UserGuide/System Tools/Performance Tracing Tool.md
@@ -43,7 +43,7 @@ IoTDB 支持使用 `TRACING` 语句来启用/禁用对查询语句的性能追
- Average size of chunks
- Total cost time
-### 例子
+### 示例
例如执行 `select * from root`,则 tracing 日志文件的内容会包括以下内容: