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 2019/12/30 10:56:32 UTC
[incubator-iotdb] branch session_doc created (now ef92e8f)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a change to branch session_doc
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.
at ef92e8f chanage Session to Native API
This branch includes the following new commits:
new ef92e8f chanage Session to Native API
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-iotdb] 01/01: chanage Session to Native API
Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch session_doc
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit ef92e8f23b21a62fba1c2b96841c4fc9cc504de7
Author: qiaojialin <64...@qq.com>
AuthorDate: Mon Dec 30 18:54:02 2019 +0800
chanage Session to Native API
---
...ing - Session.md => 2-Programming - Native API.md} | 19 +++++++------------
...-Programming - JDBC.md => 3-Programming - JDBC.md} | 0
...ing - Session.md => 2-Programming - Native API.md} | 19 +++++++------------
...-Programming - JDBC.md => 3-Programming - JDBC.md} | 9 +--------
.../UserGuide/4-Client/5-Programming - TsFile API.md | 3 +--
.../main/java/org/apache/iotdb/SessionExample.java | 15 +++++++++++++++
6 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/docs/Documentation-CHN/UserGuide/4-Client/3-Programming - Session.md b/docs/Documentation-CHN/UserGuide/4-Client/2-Programming - Native API.md
similarity index 81%
rename from docs/Documentation-CHN/UserGuide/4-Client/3-Programming - Session.md
rename to docs/Documentation-CHN/UserGuide/4-Client/2-Programming - Native API.md
index 49dbb1f..86d6a57 100644
--- a/docs/Documentation-CHN/UserGuide/4-Client/3-Programming - Session.md
+++ b/docs/Documentation-CHN/UserGuide/4-Client/2-Programming - Native API.md
@@ -21,24 +21,19 @@
# 第4章: 客户端
-# 编程 - Session
+# 编程 - 原生接口
## 依赖
* JDK >= 1.8
* Maven >= 3.1
-## 仅在client模块中打包
-
-在根目录下运行:
-> mvn clean package -pl client -am -Dmaven.test.skip=true
-
## 安装到本地 maven 库
在根目录下运行:
> mvn clean install -pl session -am -Dmaven.test.skip=true
-## 在 maven 中使用 session 接口
+## 在 maven 中使用原生接口
```
<dependencies>
@@ -50,10 +45,10 @@
</dependencies>
```
-## Session 接口使用示例
+## 原生接口使用示例
下面将给出Session对应的接口的简要介绍和对应参数:
-### 启动Session的相关命令:
+### 建立连接
* 初始化Session
Session(String host, int port)
@@ -66,7 +61,7 @@
* 关闭Session
Session.close()
-### Session的相关数据操作命令
+### 数据操作接口
* 设置存储组
@@ -101,6 +96,6 @@
### 示例代码
- 浏览上述接口的详细信息,请参阅代码session/src/main/java/org/apache/iotdb/session/Session.java
+浏览上述接口的详细信息,请参阅代码 ```session/src/main/java/org/apache/iotdb/session/Session.java```
- 使用上述接口的示例代码在example/session/src/main/java/org/apache/iotdb/SessionExample.java,在此文件中包含了开启session和执行批量插入等操作
\ No newline at end of file
+使用上述接口的示例代码在 ```example/session/src/main/java/org/apache/iotdb/SessionExample.java```
\ No newline at end of file
diff --git a/docs/Documentation-CHN/UserGuide/4-Client/2-Programming - JDBC.md b/docs/Documentation-CHN/UserGuide/4-Client/3-Programming - JDBC.md
similarity index 100%
rename from docs/Documentation-CHN/UserGuide/4-Client/2-Programming - JDBC.md
rename to docs/Documentation-CHN/UserGuide/4-Client/3-Programming - JDBC.md
diff --git a/docs/Documentation/UserGuide/4-Client/3-Programming - Session.md b/docs/Documentation/UserGuide/4-Client/2-Programming - Native API.md
similarity index 91%
rename from docs/Documentation/UserGuide/4-Client/3-Programming - Session.md
rename to docs/Documentation/UserGuide/4-Client/2-Programming - Native API.md
index 83261c0..336f711 100644
--- a/docs/Documentation/UserGuide/4-Client/3-Programming - Session.md
+++ b/docs/Documentation/UserGuide/4-Client/2-Programming - Native API.md
@@ -20,7 +20,7 @@
-->
# Chapter 4: Client
-# Programming - Session
+# Programming - Native API
## Usage
### Dependencies
@@ -28,17 +28,12 @@
* JDK >= 1.8
* Maven >= 3.1
-### How to package only client module
-
-In root directory:
-> mvn clean package -pl client -am -Dmaven.test.skip=true
-
### How to install in local maven repository
In root directory:
-> mvn clean install -pl client -am -Dmaven.test.skip=true
+> mvn clean install -pl session -am -DskipTests
-### Using IoTDB Session with Maven
+### Using IoTDB Native API with Maven
```
<dependencies>
@@ -51,11 +46,11 @@ In root directory:
```
-### Examples with Session interfaces
+### Examples with Native API
-Here we show the commonly used interfaces and their parameters in the Session:
+Here we show the commonly used interfaces and their parameters in the Native API:
-#### Run the Session
+#### Run the Native API
* Initialize a Session
@@ -73,7 +68,7 @@ Here we show the commonly used interfaces and their parameters in the Session:
Session.close()
-#### Operate the Session
+#### Operations
* Set storage group
diff --git a/docs/Documentation/UserGuide/4-Client/2-Programming - JDBC.md b/docs/Documentation/UserGuide/4-Client/3-Programming - JDBC.md
similarity index 98%
rename from docs/Documentation/UserGuide/4-Client/2-Programming - JDBC.md
rename to docs/Documentation/UserGuide/4-Client/3-Programming - JDBC.md
index 79dd538..9114020 100644
--- a/docs/Documentation/UserGuide/4-Client/2-Programming - JDBC.md
+++ b/docs/Documentation/UserGuide/4-Client/3-Programming - JDBC.md
@@ -29,13 +29,6 @@
* JDK >= 1.8
* Maven >= 3.1
-## How to package only jdbc project
-
-In root directory:
-```
-mvn clean package -pl jdbc -am -Dmaven.test.skip=true
-```
-
## How to install in local maven repository
In root directory:
@@ -50,7 +43,7 @@ mvn clean install -pl jdbc -am -Dmaven.test.skip=true
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-jdbc</artifactId>
- <version>0.8.0</version>
+ <version>0.10.0</version>
</dependency>
</dependencies>
```
diff --git a/docs/Documentation/UserGuide/4-Client/5-Programming - TsFile API.md b/docs/Documentation/UserGuide/4-Client/5-Programming - TsFile API.md
index b4771d8..7838218 100644
--- a/docs/Documentation/UserGuide/4-Client/5-Programming - TsFile API.md
+++ b/docs/Documentation/UserGuide/4-Client/5-Programming - TsFile API.md
@@ -24,8 +24,7 @@
TsFile is a file format of Time Series we used in IoTDB. In this section, we would like to introduce the usage of this file format.
-## TsFile libaray Installation
-
+## TsFile library Installation
There are two ways to use TsFile in your own project.
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index bc526a8..b8b1d9e 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -105,7 +105,22 @@ public class SessionExample {
session.insertInBatch(deviceIds, timestamps, measurementsList, valuesList);
}
+ /**
+ * insert a batch data of one device, each batch contains multiple timestamps with values of sensors
+ *
+ * a RowBatch example:
+ *
+ * device1
+ * time s1, s2, s3
+ * 1, 1, 1, 1
+ * 2, 2, 2, 2
+ * 3, 3, 3, 3
+ *
+ * Users need to control the count of RowBatch and write a batch when it reaches the maxBatchSize
+ *
+ */
private static void insertRowBatch() throws IoTDBSessionException {
+ // The schema of sensors of one device
Schema schema = new Schema();
schema.registerMeasurement(new MeasurementSchema("s1", TSDataType.INT64, TSEncoding.RLE));
schema.registerMeasurement(new MeasurementSchema("s2", TSDataType.INT64, TSEncoding.RLE));