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/06/16 06:38:54 UTC

[iotdb] branch master updated: Update User Guide (#3405)

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 b6a66e1  Update User Guide (#3405)
b6a66e1 is described below

commit b6a66e152c39718c99ca804ebdde29b335608512
Author: 肖志红 <73...@users.noreply.github.com>
AuthorDate: Wed Jun 16 14:38:18 2021 +0800

    Update User Guide (#3405)
---
 docs/zh/UserGuide/API/Programming-Go-Native-API.md | 28 +++++++++++++--
 .../UserGuide/API/Programming-Java-Native-API.md   |  8 ++---
 docs/zh/UserGuide/API/Programming-TsFile-API.md    | 41 +++++++++++++++++-----
 .../Advanced-Features/UDF-User-Defined-Function.md |  2 +-
 docs/zh/UserGuide/Appendix/Config-Manual.md        |  8 ++---
 docs/zh/UserGuide/Appendix/SQL-Reference.md        | 14 ++++----
 docs/zh/UserGuide/Appendix/Status-Codes.md         |  6 ++--
 .../Collaboration-of-Edge-and-Cloud/Sync-Tool.md   |  4 +--
 .../Programming-Thrift.md                          |  2 +-
 .../Ecosystem Integration/Spark TsFile.md          |  1 +
 .../Ecosystem Integration/Zeppelin-IoTDB.md        |  2 +-
 .../UserGuide/System-Tools/Load-External-Tsfile.md |  4 +--
 .../System-Tools/Monitor-and-Log-Tools.md          |  2 +-
 13 files changed, 84 insertions(+), 38 deletions(-)

diff --git a/docs/zh/UserGuide/API/Programming-Go-Native-API.md b/docs/zh/UserGuide/API/Programming-Go-Native-API.md
index d8b7092..b4f55d0 100644
--- a/docs/zh/UserGuide/API/Programming-Go-Native-API.md
+++ b/docs/zh/UserGuide/API/Programming-Go-Native-API.md
@@ -38,14 +38,25 @@
  * 通过go mod
 
 ```sh
+# 切换到GOPATH的HOME路径,启用Go Modules功能
 export GO111MODULE=on
+
+# 配置GOPROXY环境变量
 export GOPROXY=https://goproxy.io
 
+# 创建命名的文件夹或目录,并切换当前目录
 mkdir session_example && cd session_example
 
+# 保存文件,自动跳转到新的地址
 curl -o session_example.go -L https://github.com/apache/iotdb-client-go/raw/main/example/session_example.go
 
+# 初始化go module环境
 go mod init session_example
+
+# 下载依赖包
+go mod tidy
+
+# 编译并运行程序
 go run session_example.go
 ```
 
@@ -53,13 +64,24 @@ go run session_example.go
 
 ```sh
 # get thrift 0.13.0
-go get github.com/apache/thrift
-cd $GOPATH/src/github.com/apache/thrift
-git checkout 0.13.0
+go get github.com/apache/thrift@0.13.0
 
+# 递归创建目录
 mkdir -p $GOPATH/src/iotdb-client-go-example/session_example
+
+# 切换到当前目录
 cd $GOPATH/src/iotdb-client-go-example/session_example
+
+# 保存文件,自动跳转到新的地址
 curl -o session_example.go -L https://github.com/apache/iotdb-client-go/raw/main/example/session_example.go
+
+# 初始化go module 环境
+go mod init
+
+# 下载依赖包
+go mod tidy
+
+# 编译并运行程序
 go run session_example.go
 ```
 
diff --git a/docs/zh/UserGuide/API/Programming-Java-Native-API.md b/docs/zh/UserGuide/API/Programming-Java-Native-API.md
index 9316b49..db91d13 100644
--- a/docs/zh/UserGuide/API/Programming-Java-Native-API.md
+++ b/docs/zh/UserGuide/API/Programming-Java-Native-API.md
@@ -122,8 +122,8 @@ void deleteTimeseries(List<String> paths)
 * 删除一个或多个时间序列在某个时间点前或这个时间点的数据
 
 ```java
-void deleteData(String path, long time)
-void deleteData(List<String> paths, long time)
+void deleteData(String path, long endTime)
+void deleteData(List<String> paths, long endTime)
 ```
 
 * 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。服务器需要做类型推断,可能会有额外耗时
@@ -141,7 +141,7 @@ void insertTablet(Tablet tablet)
 * 插入多个 Tablet
 
 ```java
-void insertTablets(Map<String, Tablet> tablet)
+void insertTablets(Map<String, Tablet> tablets)
 ```
 
 * 插入多个 Record。服务器需要做类型推断,可能会有额外耗时
@@ -162,7 +162,7 @@ void insertRecord(String prefixPath, long time, List<String> measurements,
 
 ```java
 void insertRecords(List<String> deviceIds, List<Long> times,
-    List<List<String>> measurementsList, List<List<TSDataType>> typesList,
+    List<List<String>> measurementsList,
     List<List<Object>> valuesList)
 ```
 
diff --git a/docs/zh/UserGuide/API/Programming-TsFile-API.md b/docs/zh/UserGuide/API/Programming-TsFile-API.md
index bfcfab8..a546059 100644
--- a/docs/zh/UserGuide/API/Programming-TsFile-API.md
+++ b/docs/zh/UserGuide/API/Programming-TsFile-API.md
@@ -493,7 +493,7 @@ public QueryDataSet query(QueryExpression queryExpression, long partitionStartOf
 您需要安装 TsFile 到本地的 Maven 仓库中。
 
 有关查询语句的更详细示例,请参见
-`/tsfile/example/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java`
+`/example/tsfile/src/main/java/org/apache/iotdb/tsfile/TsFileRead.java`
 
 ```java
 package org.apache.iotdb.tsfile;
@@ -517,6 +517,8 @@ import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
  * Run TsFileWrite to generate the test.tsfile first
  */
 public class TsFileRead {
+  private static final String DEVICE1 = "device_1";
+  
   private static void queryAndPrint(ArrayList<Path> paths, ReadOnlyTsFile readTsFile, IExpression statement)
           throws IOException {
     QueryExpression queryExpression = QueryExpression.create(paths, statement);
@@ -533,19 +535,40 @@ public class TsFileRead {
     String path = "test.tsfile";
 
     // create reader and get the readTsFile interface
-    TsFileSequenceReader reader = new TsFileSequenceReader(path);
-    ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader);
+    try (TsFileSequenceReader reader = new TsFileSequenceReader(path);
+         ReadOnlyTsFile readTsFile = new ReadOnlyTsFile(reader)){
+	 
     // use these paths(all sensors) for all the queries
     ArrayList<Path> paths = new ArrayList<>();
-    paths.add(new Path("device_1.sensor_1"));
-    paths.add(new Path("device_1.sensor_2"));
-    paths.add(new Path("device_1.sensor_3"));
+    paths.add(new Path(DEVICE1, "sensor_1"));
+    paths.add(new Path(DEVICE1, "sensor_2"));
+    paths.add(new Path(DEVICE1, "sensor_3"));
 
-    // no query statement
+    // no filter, should select 1 2 3 4 6 7 8
     queryAndPrint(paths, readTsFile, null);
 
-    //close the reader when you left
-    reader.close();
+   // time filter : 4 <= time <= 10, should select 4 6 7 8
+    IExpression timeFilter =
+       BinaryExpression.and(
+           new GlobalTimeExpression(TimeFilter.gtEq(4L)),
+           new GlobalTimeExpression(TimeFilter.ltEq(10L)));
+    queryAndPrint(paths, readTsFile, timeFilter);
+
+   // value filter : device_1.sensor_2 <= 20, should select 1 2 4 6 7
+    IExpression valueFilter =
+        new SingleSeriesExpression(new Path(DEVICE1, "sensor_2"), ValueFilter.ltEq(20L));
+    queryAndPrint(paths, readTsFile, valueFilter);
+
+   // time filter : 4 <= time <= 10, value filter : device_1.sensor_3 >= 20, should select 4 7 8
+    timeFilter =
+        BinaryExpression.and(
+            new GlobalTimeExpression(TimeFilter.gtEq(4L)),
+            new GlobalTimeExpression(TimeFilter.ltEq(10L)));
+    valueFilter =
+        new SingleSeriesExpression(new Path(DEVICE1, "sensor_3"), ValueFilter.gtEq(20L));
+    IExpression finalFilter = BinaryExpression.and(timeFilter, valueFilter);
+    queryAndPrint(paths, readTsFile, finalFilter);
+    }
   }
 }
 ```
diff --git a/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md b/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
index ee95744..3dfcef1 100644
--- a/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
+++ b/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
@@ -482,7 +482,7 @@ SELECT example(s1, s2, "key1"="value1", "key2"="value2") FROM root.sg.d1;
 
 ``` sql
 SELECT s1, s2, example(s1, s2) FROM root.sg.d1;
-SELECT *, example(*) FROM root.sg.d1 NON ALIGN;
+SELECT *, example(*) FROM root.sg.d1 DISABLE ALIGN;
 ```
 
 暂不支持UDF查询与其他查询混合使用。
diff --git a/docs/zh/UserGuide/Appendix/Config-Manual.md b/docs/zh/UserGuide/Appendix/Config-Manual.md
index b637305..4025d57 100644
--- a/docs/zh/UserGuide/Appendix/Config-Manual.md
+++ b/docs/zh/UserGuide/Appendix/Config-Manual.md
@@ -36,7 +36,7 @@
 为方便用户使用,IoTDB Server为用户提供了热修改功能,即在系统运行过程中修改`iotdb-engine.properties`中部分配置参数并即时应用到系统中。下面介绍的参数中,改后
 生效方式为`触发生效`的均为支持热修改的配置参数。
 
-触发方式:客户端发送```load configuration```命令至IoTDB Server,客户端的使用方式详见第4章
+触发方式:客户端发送```load configuration```命令至IoTDB Server,客户端的使用方式详见[SQL命令行终端(CLI)](https://iotdb.apache.org/zh/UserGuide/Master/CLI/Command-Line-Interface.html)
 
 ## 环境配置项
 
@@ -46,9 +46,9 @@
 
 |名字|JMX\_LOCAL|
 |:---:|:---|
-|描述|JMX监控模式,配置为yes表示仅允许本地监控,设置为no的时候表示允许远程监控|
-|类型|枚举String : “yes”, “no”|
-|默认值|yes|
+|描述|JMX监控模式,配置为true表示仅允许本地监控,设置为false的时候表示允许远程监控|
+|类型|枚举String : “true”, “false”|
+|默认值|true|
 |改后生效方式|重启服务生效|
 
 
diff --git a/docs/zh/UserGuide/Appendix/SQL-Reference.md b/docs/zh/UserGuide/Appendix/SQL-Reference.md
index faca9c3..d8942c4 100644
--- a/docs/zh/UserGuide/Appendix/SQL-Reference.md
+++ b/docs/zh/UserGuide/Appendix/SQL-Reference.md
@@ -50,9 +50,7 @@ Note: FullPath can not include `*`
 
 ```
 DELETE STORAGE GROUP <FullPath> [COMMA <FullPath>]*
-Eg: IoTDB > DELETE STORAGE GROUP root.ln.wf01.wt01
-Eg: IoTDB > DELETE STORAGE GROUP root.ln.wf01.wt01, root.ln.wf01.wt02
-Eg: IoTDB > DELETE STORAGE GROUP root.ln.wf01.*
+Eg: IoTDB > DELETE STORAGE GROUP root.ln
 Eg: IoTDB > DELETE STORAGE GROUP root.*
 ```
 
@@ -356,7 +354,7 @@ TimeExpr : TIME PrecedenceEqualOperator (<TimeValue> | <RelativeTime>)
 RelativeTimeDurationUnit = Integer ('Y'|'MO'|'W'|'D'|'H'|'M'|'S'|'MS'|'US'|'NS')
 RelativeTime : (now() | <TimeValue>) [(+|-) RelativeTimeDurationUnit]+
 SensorExpr : (<Timeseries> | <Path>) PrecedenceEqualOperator <PointValue>
-Eg: IoTDB > SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > 2017-11-1 0:13:00
+Eg: IoTDB > SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > 2017-11-01 00:13:00
 Eg. IoTDB > SELECT * FROM root
 Eg. IoTDB > SELECT * FROM root where time > now() - 5m
 Eg. IoTDB > SELECT * FROM root.ln.*.wf*
@@ -440,6 +438,8 @@ Note: Integer in <TimeUnit> needs to be greater than 0
 * Group By Fill语句
 
 ```
+# time区间规则为:只能为左开右闭或左闭右开,例如:[20, 100)
+
 SELECT <SelectClause> FROM <FromClause> WHERE  <WhereClause> GROUP BY <GroupByClause> (FILL <GROUPBYFillClause>)?
 GroupByClause : LPAREN <TimeInterval> COMMA <TimeUnit> RPAREN
 GROUPBYFillClause : LPAREN <TypeClause> RPAREN
@@ -499,8 +499,8 @@ SLIMITClause : SLIMIT <SN> [SOFFSETClause]?
 SN : Integer
 SOFFSETClause : SOFFSET <SOFFSETValue>
 SOFFSETValue : Integer
-Eg: IoTDB > SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > 2017-11-1 0:13:00 LIMIT 3 OFFSET 2
-Eg. IoTDB > SELECT COUNT (status), MAX_VALUE(temperature) FROM root.ln.wf01.wt01 WHERE time < 1509466500000 GROUP BY([1509465720000, 1509466380000], 5m) LIMIT 3
+Eg: IoTDB > SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > 2017-11-01 00:13:00 LIMIT 3 OFFSET 2
+Eg. IoTDB > SELECT COUNT (status), MAX_VALUE(temperature) FROM root.ln.wf01.wt01 WHERE time < 1509466500000 GROUP BY([1509465720000, 1509466380000), 5m) LIMIT 3
 Note: N, OFFSETValue, SN and SOFFSETValue must be greater than 0.
 Note: The order of <LIMITClause> and <SLIMITClause> does not affect the grammatical correctness.
 Note: <FillClause> can not use <LIMITClause> but not <SLIMITClause>.
@@ -714,7 +714,7 @@ E.g. select * as temperature from root.sg.d1
 CREATE USER <userName> <password>;  
 userName:=identifier  
 password:=string
-Eg: IoTDB > CREATE USER thulab 'pwd';
+Eg: IoTDB > CREATE USER thulab 'passwd';
 ```
 
 * 删除用户
diff --git a/docs/zh/UserGuide/Appendix/Status-Codes.md b/docs/zh/UserGuide/Appendix/Status-Codes.md
index ca5ebee..d3ce65c 100644
--- a/docs/zh/UserGuide/Appendix/Status-Codes.md
+++ b/docs/zh/UserGuide/Appendix/Status-Codes.md
@@ -44,9 +44,9 @@ try {
 
 |状态码|状态类型|状态信息|
 |:---|:---|:---|
-|200|SUCCESS_STATUS||
-|201|STILL_EXECUTING_STATUS||
-|202|INVALID_HANDLE_STATUS||
+|200|SUCCESS_STATUS|成功状态|
+|201|STILL_EXECUTING_STATUS|仍在执行状态|
+|202|INVALID_HANDLE_STATUS|无效句柄状态|
 |203|INCOMPATIBLE_VERSION|版本不兼容|
 |298|NODE_DELETE_FAILED_ERROR|删除节点失败|
 |299|ALIAS_ALREADY_EXIST_ERROR|路径别名已经存在|
diff --git a/docs/zh/UserGuide/Collaboration-of-Edge-and-Cloud/Sync-Tool.md b/docs/zh/UserGuide/Collaboration-of-Edge-and-Cloud/Sync-Tool.md
index 654eace..0549f05 100644
--- a/docs/zh/UserGuide/Collaboration-of-Edge-and-Cloud/Sync-Tool.md
+++ b/docs/zh/UserGuide/Collaboration-of-Edge-and-Cloud/Sync-Tool.md
@@ -27,9 +27,9 @@
 
 同步工具是定期将本地磁盘中新增的已持久化的tsfile文件上传至云端并加载到IoTDB的套件工具。
 
-在同步工具的发送端,同步模块是一个独立的进程,独立于本地的IoTDB。通过独立的脚本进行启动和关闭(详见章节`使用方式`),同步的频率周期可由用户设置。
+在同步工具的发送端,同步模块是一个独立的进程,独立于本地的IoTDB。通过独立的脚本进行启动和关闭(详见本章节`使用方式`),同步的频率周期可由用户设置。
 
-在同步工具的接收端,同步模块内嵌于IoTDB的引擎,和IoTDB处于同一个进程中。同步模块监听一个独立的端口,该端口可由用户设置(详见章节`配置参数`)。用户使用前,需要在同步接收端设置同步白名单,以网段形式表示,接收端的同步模块只接受位于白名单网段中的发送端同步的数据。
+在同步工具的接收端,同步模块内嵌于IoTDB的引擎,和IoTDB处于同一个进程中。同步模块监听一个独立的端口,该端口可由用户设置(详见本章节`配置参数`)。用户使用前,需要在同步接收端设置同步白名单,以网段形式表示,接收端的同步模块只接受位于白名单网段中的发送端同步的数据。
 
 同步工具具有多对一的发送-接受模式,即一个同步接收端可以同时接受多个同步发送端传输的数据,一个同步发送端只能向一个同步接收端发送数据。
 
diff --git a/docs/zh/UserGuide/Communication-Service-Protocol/Programming-Thrift.md b/docs/zh/UserGuide/Communication-Service-Protocol/Programming-Thrift.md
index 4a1893b..091d645 100644
--- a/docs/zh/UserGuide/Communication-Service-Protocol/Programming-Thrift.md
+++ b/docs/zh/UserGuide/Communication-Service-Protocol/Programming-Thrift.md
@@ -149,7 +149,7 @@ i64 requestStatementId(1:i64 sessionId);
 ```
 
 ### IDL定义文件位置
-IDL定义文件的路径是thrift/src/main/thrift/rpc.thrift,其中包括了结构体定义与函数定义、
+IDL定义文件的路径是thrift/src/main/thrift/rpc.thrift,其中包括了结构体定义与函数定义
 
 ### 生成文件位置
 在mvn编译过程中,会调用thrift编译IDL文件,生成最终的.class文件
diff --git a/docs/zh/UserGuide/Ecosystem Integration/Spark TsFile.md b/docs/zh/UserGuide/Ecosystem Integration/Spark TsFile.md
index 8718855..4cf680e 100644
--- a/docs/zh/UserGuide/Ecosystem Integration/Spark TsFile.md	
+++ b/docs/zh/UserGuide/Ecosystem Integration/Spark TsFile.md	
@@ -53,6 +53,7 @@ TsFile-Spark-Connector对Tsfile类型的外部数据源实现Spark的支持。 
 - \<spark-shell-path\>是您的spark-shell的真实路径。
 - 多个jar包用逗号分隔,没有任何空格。
 - 有关如何获取TsFile的信息,请参见https://github.com/apache/iotdb/tree/master/tsfile。
+- 获取到dependency 包:```mvn clean package -DskipTests -P get-jar-with-dependencies```
 
 #### 分布式模式
 
diff --git a/docs/zh/UserGuide/Ecosystem Integration/Zeppelin-IoTDB.md b/docs/zh/UserGuide/Ecosystem Integration/Zeppelin-IoTDB.md
index 6576c99..9c9911b 100644
--- a/docs/zh/UserGuide/Ecosystem Integration/Zeppelin-IoTDB.md	
+++ b/docs/zh/UserGuide/Ecosystem Integration/Zeppelin-IoTDB.md	
@@ -38,7 +38,7 @@ Apache Zeppelin 是一个基于网页的交互式数据分析系统。用户可
 | :--------: | :-----------: | :-----------: |
 | >=`0.12.0` | >=`1.8.0_271` |   `>=0.9.0`   |
 
-安装 IoTDB:参考 [Quick Start](QuickStart/QuickStart.html). 假设 IoTDB 安装在 `$IoTDB_HOME`.
+安装 IoTDB:参考 [快速上手](https://iotdb.apache.org/zh/UserGuide/Master/QuickStart/QuickStart.html). 假设 IoTDB 安装在 `$IoTDB_HOME`.
 
 安装 Zeppelin:
 > 方法1 直接下载:下载 [Zeppelin](https://zeppelin.apache.org/download.html#) 并解压二进制文件。推荐下载 [netinst](http://www.apache.org/dyn/closer.cgi/zeppelin/zeppelin-0.9.0/zeppelin-0.9.0-bin-netinst.tgz) 二进制包,此包由于未编译不相关的interpreter,因此大小相对较小。
diff --git a/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md b/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
index e530309..f8e33d1 100644
--- a/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
+++ b/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
@@ -69,9 +69,9 @@
 
 #### 移出tsfile文件至指定目录
 
-移出tsfile文件的指令为:`remove "<path>" "<dir>"`
+移出tsfile文件的指令为:`move "<path>" "<dir>"`
 
-该指令将指定路径的tsfile文件移动至目标文件夹(绝对路径)中,具体做法是在引擎中移除该tsfile,并将该tsfile文件和其对应的`.resource`文件移动到目标文件夹下
+该指令将指定路径的tsfile文件移动至目标文件夹(绝对路径)中,具体做法是在引擎中移出该tsfile,并将该tsfile文件和其对应的`.resource`文件移动到目标文件夹下
 
 示例:
 
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 fbcc67f..e59066e 100644
--- a/docs/zh/UserGuide/System-Tools/Monitor-and-Log-Tools.md
+++ b/docs/zh/UserGuide/System-Tools/Monitor-and-Log-Tools.md
@@ -99,7 +99,7 @@ Monitor下有几个属性,包括数据文件目录,写入数据统计信息
 
 #### 开启/关闭监控
 
-用户可以选择开启或关闭数据统计监控功能(您可以设定配置文件中的`enable_stat_monitor`项,详细信息参见[第3.4节](../Server/Config%20Manual.md))。
+用户可以选择开启或关闭数据统计监控功能(您可以设定配置文件中的`enable_stat_monitor`项,详细信息参见[附录1:配置参数](http://iotdb.apache.org/zh/UserGuide/Master/Appendix/Config-Manual.html))。
 
 ### 统计数据存储