This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 91ccebc Add native (#45)
91ccebc is described below
commit 91ccebc197de36901a85d282de8f51546d7a798a
Author: CritasWang <[email protected]>
AuthorDate: Tue Aug 8 17:12:54 2023 +0800
Add native (#45)
---
src/.vuepress/sidebar/V1.2.x/en.ts | 3 +
src/.vuepress/sidebar/V1.2.x/zh.ts | 7 +-
.../Master/API/Programming-CSharp-Native-API.md | 213 ++++++++++++++++
.../Master/API/Programming-NodeJS-Native-API.md | 196 +++++++++++++++
.../Master/API/Programming-Rust-Native-API.md | 198 +++++++++++++++
src/UserGuide/V1.1.x/API/InfluxDB-Protocol.md | 2 +-
.../V1.2.x/API/Programming-CSharp-Native-API.md | 213 ++++++++++++++++
.../V1.2.x/API/Programming-NodeJS-Native-API.md | 196 +++++++++++++++
.../V1.2.x/API/Programming-Rust-Native-API.md | 198 +++++++++++++++
.../{V1.1.x => Master}/API/InfluxDB-Protocol.md | 2 +-
.../Master/API/Programming-CSharp-Native-API.md | 274 +++++++++++++++++++++
.../Master/API/Programming-NodeJS-Native-API.md | 201 +++++++++++++++
.../Master/API/Programming-Rust-Native-API.md | 200 +++++++++++++++
.../Deployment-Guide_timecho.md | 30 +--
.../Tools-System/Maintenance-Tool_timecho.md | 30 +--
src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md | 2 +-
.../{V1.1.x => V1.2.x}/API/InfluxDB-Protocol.md | 2 +-
.../V1.2.x/API/Programming-CSharp-Native-API.md | 274 +++++++++++++++++++++
.../V1.2.x/API/Programming-NodeJS-Native-API.md | 201 +++++++++++++++
.../V1.2.x/API/Programming-Rust-Native-API.md | 200 +++++++++++++++
.../Deployment-Guide_timecho.md | 30 +--
.../Tools-System/Maintenance-Tool_timecho.md | 30 +--
22 files changed, 2588 insertions(+), 114 deletions(-)
diff --git a/src/.vuepress/sidebar/V1.2.x/en.ts
b/src/.vuepress/sidebar/V1.2.x/en.ts
index e671fa8..f6a65a0 100644
--- a/src/.vuepress/sidebar/V1.2.x/en.ts
+++ b/src/.vuepress/sidebar/V1.2.x/en.ts
@@ -112,6 +112,9 @@ export const enSidebar = {
{ text: 'Python Native API', link: 'Programming-Python-Native-API' },
{ text: 'C++ Native API', link: 'Programming-Cpp-Native-API' },
{ text: 'Go Native API', link: 'Programming-Go-Native-API' },
+ { text: 'C# Native API', link: 'Programming-CSharp-Native-API' },
+ { text: 'Node.js Native API', link: 'Programming-NodeJS-Native-API' },
+ { text: 'Rust Native API', link: 'Programming-Rust-Native-API' },
{ text: 'JDBC (Not Recommend)', link: 'Programming-JDBC' },
{ text: 'MQTT', link: 'Programming-MQTT' },
{ text: 'Kafka', link: 'Programming-Kafka' },
diff --git a/src/.vuepress/sidebar/V1.2.x/zh.ts
b/src/.vuepress/sidebar/V1.2.x/zh.ts
index c070a9e..5aea42f 100644
--- a/src/.vuepress/sidebar/V1.2.x/zh.ts
+++ b/src/.vuepress/sidebar/V1.2.x/zh.ts
@@ -113,6 +113,9 @@ export const zhSidebar = {
{ text: 'Python', link: 'Programming-Python-Native-API' },
{ text: 'C++', link: 'Programming-Cpp-Native-API' },
{ text: 'Go', link: 'Programming-Go-Native-API' },
+ { text: 'C#', link: 'Programming-CSharp-Native-API' },
+ { text: 'Node.js', link: 'Programming-NodeJS-Native-API' },
+ { text: 'Rust', link: 'Programming-Rust-Native-API' },
{ text: 'JDBC (不推荐)', link: 'Programming-JDBC' },
{ text: 'MQTT', link: 'Programming-MQTT' },
{ text: 'Kafka', link: 'Programming-Kafka' },
@@ -154,7 +157,7 @@ export const zhSidebar = {
prefix: 'FAQ/',
// children: 'structure',
children: [
- { text: '常见问题', link: 'Frequently-asked-questions' }, ],
+ { text: '常见问题', link: 'Frequently-asked-questions' }],
},
{
text: '参考',
@@ -168,4 +171,4 @@ export const zhSidebar = {
],
},
],
-};
\ No newline at end of file
+};
diff --git a/src/UserGuide/Master/API/Programming-CSharp-Native-API.md
b/src/UserGuide/Master/API/Programming-CSharp-Native-API.md
new file mode 100644
index 0000000..c18db2a
--- /dev/null
+++ b/src/UserGuide/Master/API/Programming-CSharp-Native-API.md
@@ -0,0 +1,213 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# C# Native API
+
+## Installation
+
+### Install from NuGet Package
+
+We have prepared Nuget Package for C# users. Users can directly install the
client through .NET CLI. [The link of our NuGet Package is
here](https://www.nuget.org/packages/Apache.IoTDB/). Run the following command
in the command line to complete installation
+
+```sh
+dotnet add package Apache.IoTDB
+```
+
+Note that the `Apache.IoTDB` package only supports versions greater than `.net
framework 4.6.1`.
+
+## Prerequisites
+
+ .NET SDK Version >= 5.0
+ .NET Framework >= 4.6.1
+
+## How to Use the Client (Quick Start)
+
+Users can quickly get started by referring to the use cases under the
Apache-IoTDB-Client-CSharp-UserCase directory. These use cases serve as a
useful resource for getting familiar with the client's functionality and
capabilities.
+
+For those who wish to delve deeper into the client's usage and explore more
advanced features, the samples directory contains additional code samples.
+
+## Developer environment requirements for iotdb-client-csharp
+
+```
+.NET SDK Version >= 5.0
+.NET Framework >= 4.6.1
+ApacheThrift >= 0.14.1
+NLog >= 4.7.9
+```
+
+### OS
+
+* Linux, Macos or other unix-like OS
+* Windows+bash(WSL, cygwin, Git Bash)
+
+### Command Line Tools
+
+* dotnet CLI
+* Thrift
+
+## Basic interface description
+
+The Session interface is semantically identical to other language clients
+
+```csharp
+// Parameters
+string host = "localhost";
+int port = 6667;
+int pool_size = 2;
+
+// Init Session
+var session_pool = new SessionPool(host, port, pool_size);
+
+// Open Session
+await session_pool.Open(false);
+
+// Create TimeSeries
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts1",
TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts2",
TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts3",
TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+
+// Insert Record
+var measures = new List<string>{"ts1", "ts2", "ts3"};
+var values = new List<object> { "test_text", true, (int)123 };
+var timestamp = 1;
+var rowRecord = new RowRecord(timestamp, values, measures);
+await session_pool.InsertRecordAsync("root.test_group.test_device", rowRecord);
+
+// Insert Tablet
+var timestamp_lst = new List<long>{ timestamp + 1 };
+var value_lst = new List<object> {new() {"iotdb", true, (int) 12}};
+var tablet = new Tablet("root.test_group.test_device", measures, value_lst,
timestamp_ls);
+await session_pool.InsertTabletAsync(tablet);
+
+// Close Session
+await session_pool.Close();
+```
+
+## **Row Record**
+
+- Encapsulate and abstract the `record` data in **IoTDB**
+- e.g.
+
+| timestamp | status | temperature |
+| --------- | ------ | ----------- |
+| 1 | 0 | 20 |
+
+- Construction:
+
+```csharp
+var rowRecord =
+ new RowRecord(long timestamps, List<object> values, List<string>
measurements);
+```
+
+### **Tablet**
+
+- A data structure similar to a table, containing several non empty data
blocks of a device's rows。
+- e.g.
+
+| time | status | temperature |
+| ---- | ------ | ----------- |
+| 1 | 0 | 20 |
+| 2 | 0 | 20 |
+| 3 | 3 | 21 |
+
+- Construction:
+
+```csharp
+var tablet =
+ Tablet(string deviceId, List<string> measurements, List<List<object>>
values, List<long> timestamps);
+```
+
+
+
+## **API**
+
+### **Basic API**
+
+| api name | parameters | notes | use
example |
+| -------------- | ------------------------- | ------------------------ |
----------------------------- |
+| Open | bool | open session |
session_pool.Open(false) |
+| Close | null | close session |
session_pool.Close() |
+| IsOpen | null | check if session is open |
session_pool.IsOpen() |
+| OpenDebugMode | LoggingConfiguration=null | open debug mode |
session_pool.OpenDebugMode() |
+| CloseDebugMode | null | close debug mode |
session_pool.CloseDebugMode() |
+| SetTimeZone | string | set time zone |
session_pool.GetTimeZone() |
+| GetTimeZone | null | get time zone |
session_pool.GetTimeZone() |
+
+### **Record API**
+
+| api name | parameters | notes
| use example
|
+| ----------------------------------- | ----------------------------- |
----------------------------------- |
------------------------------------------------------------ |
+| InsertRecordAsync | string, RowRecord | insert
single record |
session_pool.InsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
new RowRecord(1, values, measures)); |
+| InsertRecordsAsync | List\<string\>, List\<RowRecord\> |
insert records |
session_pool.InsertRecordsAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceAsync | string, List\<RowRecord\> |
insert records of one device |
session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceSortedAsync | string, List\<RowRecord\> |
insert sorted records of one device |
InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); |
+| TestInsertRecordAsync | string, RowRecord | test
insert record |
session_pool.TestInsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
rowRecord) |
+| TestInsertRecordsAsync | List\<string\>, List\<RowRecord\> |
test insert record |
session_pool.TestInsertRecordsAsync(device_id, rowRecords) |
+
+### **Tablet API**
+
+| api name | parameters | notes | use example
|
+| ---------------------- | ------------ | -------------------- |
-------------------------------------------- |
+| InsertTabletAsync | Tablet | insert single tablet |
session_pool.InsertTabletAsync(tablet) |
+| InsertTabletsAsync | List\<Tablet\> | insert tablets |
session_pool.InsertTabletsAsync(tablets) |
+| TestInsertTabletAsync | Tablet | test insert tablet |
session_pool.TestInsertTabletAsync(tablet) |
+| TestInsertTabletsAsync | List\<Tablet\> | test insert tablets |
session_pool.TestInsertTabletsAsync(tablets) |
+
+### **SQL API**
+
+| api name | parameters | notes
| use example |
+| ----------------------------- | ---------- | ------------------------------
| ------------------------------------------------------------ |
+| ExecuteQueryStatementAsync | string | execute sql query statement
| session_pool.ExecuteQueryStatementAsync("select * from
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE where time<15"); |
+| ExecuteNonQueryStatementAsync | string | execute sql nonquery statement
| session_pool.ExecuteNonQueryStatementAsync( "create timeseries
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.status with
datatype=BOOLEAN,encoding=PLAIN") |
+
+### **Scheam API**
+
+| api name | parameters
| notes | use example
|
+| -------------------------- |
------------------------------------------------------------ |
--------------------------- |
------------------------------------------------------------ |
+| SetStorageGroup | string
| set storage group |
session_pool.SetStorageGroup("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| CreateTimeSeries | string, TSDataType, TSEncoding, Compressor
| create time series |
session_pool.InsertTabletsAsync(tablets) |
+| DeleteStorageGroupAsync | string
| delete single storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| DeleteStorageGroupsAsync | List\<string\>
| delete storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP") |
+| CreateMultiTimeSeriesAsync | List\<string\>, List\<TSDataType\> ,
List\<TSEncoding\> , List\<Compressor\> | create multi time series |
session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst,
encoding_lst, compressor_lst); |
+| DeleteTimeSeriesAsync | List\<string\>
| delete time series |
|
+| DeleteTimeSeriesAsync | string
| delete time series |
|
+| DeleteDataAsync | List\<string\>, long, long
| delete data |
session_pool.DeleteDataAsync(ts_path_lst, 2, 3) |
+
+### **Other API**
+
+| api name | parameters | notes | use
example |
+| -------------------------- | ---------- | --------------------------- |
---------------------------------------------------- |
+| CheckTimeSeriesExistsAsync | string | check if time series exists |
session_pool.CheckTimeSeriesExistsAsync(time series) |
+
+
+
+[e.g.](https://github.com/apache/iotdb-client-csharp/tree/main/samples/Apache.IoTDB.Samples)
+
+## SessionPool
+
+To implement concurrent client requests, we provide a `SessionPool` for the
native interface. Since `SessionPool` itself is a superset of `Session`, when
`SessionPool` is a When the `pool_size` parameter is set to 1, it reverts to
the original `Session`
+
+We use the `ConcurrentQueue` data structure to encapsulate a client queue to
maintain multiple connections with the server. When the `Open()` interface is
called, a specified number of clients are created in the queue, and synchronous
access to the queue is achieved through the `System.Threading.Monitor` class.
+
+When a request occurs, it will try to find an idle client connection from the
Connection pool. If there is no idle connection, the program will need to wait
until there is an idle connection
+
+When a connection is used up, it will automatically return to the pool and
wait for the next time it is used up
+
diff --git a/src/UserGuide/Master/API/Programming-NodeJS-Native-API.md
b/src/UserGuide/Master/API/Programming-NodeJS-Native-API.md
new file mode 100644
index 0000000..cae3f91
--- /dev/null
+++ b/src/UserGuide/Master/API/Programming-NodeJS-Native-API.md
@@ -0,0 +1,196 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Node.js Native API
+
+IoTDB uses Thrift as a cross language RPC framework, so access to IoTDB can be
achieved through the interface provided by Thrift. This document will introduce
how to generate a native Node.js interface that can access IoTDB.
+
+## Dependents
+
+ * JDK >= 1.8
+ * Node.js >= 16.0.0
+ * thrift 0.14.1
+ * Linux、Macos or like unix
+ * Windows+bash
+
+Thrift (0.14.1 or higher) must be installed to compile Thrift files into
Node.js code. The following is the official installation tutorial, and in the
end, you should receive a Thrift executable file.
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## Compile the Thrift library and generate the Node.js native interface
+
+1. Find the pom.xml file in the root directory of the IoTDB source code folder.
+2. Open the pom.xml file and find the following content:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. Referring to this setting, add the following content to the pom.xml file to
generate the native interface for Node.js:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-nodejs</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>js:node</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-nodejs</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. In the root directory of the IoTDB source code folder,run `mvn clean
generate-sources`,
+
+This command will automatically delete the files in
`iotdb/iotdb-protocol/thrift/target` and
`iotdb/iotdb-protocol/thrift-commons/target`, and repopulate the folder with
the newly generated throttle file.
+
+
+## Using the Node.js native interface
+
+copy `iotdb/iotdb-protocol/thrift/target/generated-sources-nodejs/` and
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-nodejs/` in your
project。
+
+
+## rpc interface
+
+```
+// open a session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// close a session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// run an SQL statement in batch
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// execute SQL statement in batch
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// execute query SQL statement
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// execute insert, delete and update SQL statement
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// fetch next query result
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// fetch meta data
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// cancel a query
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// close a query dataset
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// get time zone
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// set time zone
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// get server's properties
+ServerProperties getProperties();
+
+// CREATE DATABASE
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// create timeseries
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// create multi timeseries
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// delete timeseries
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// delete sttorage groups
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// insert record
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// insert record in string format
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// insert tablet
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// insert tablets in batch
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// insert records in batch
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// insert records of one device
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// insert records in batch as string format
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// test the latency of innsert tablet,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// test the latency of innsert tablets,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// test the latency of innsert record,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// test the latency of innsert record in string format,caution:no data will be
inserted, only for test latency
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// test the latency of innsert records,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// test the latency of innsert records of one device,caution:no data will be
inserted, only for test latency
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// test the latency of innsert records in string formate,caution:no data will
be inserted, only for test latency
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// delete data
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// execute raw data query
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// request a statement id from server
+i64 requestStatementId(1:i64 sessionId);
+```
\ No newline at end of file
diff --git a/src/UserGuide/Master/API/Programming-Rust-Native-API.md
b/src/UserGuide/Master/API/Programming-Rust-Native-API.md
new file mode 100644
index 0000000..a5bbacf
--- /dev/null
+++ b/src/UserGuide/Master/API/Programming-Rust-Native-API.md
@@ -0,0 +1,198 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Rust Native API Native API
+
+IoTDB uses Thrift as a cross language RPC framework, so access to IoTDB can be
achieved through the interface provided by Thrift. This document will introduce
how to generate a native Rust interface that can access IoTDB.
+
+
+## Dependents
+
+ * JDK >= 1.8
+ * Rust >= 1.0.0
+ * thrift 0.14.1
+ * Linux、Macos or like unix
+ * Windows+bash
+
+Thrift (0.14.1 or higher) must be installed to compile Thrift files into Rust
code. The following is the official installation tutorial, and in the end, you
should receive a Thrift executable file.
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## Compile the Thrift library and generate the Rust native interface
+
+1. Find the pom.xml file in the root directory of the IoTDB source code folder.
+2. Open the pom.xml file and find the following content:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. Referring to this setting, add the following content to the pom.xml file to
generate the native interface for Rust:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-rust</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>rs</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-rust</outputDirectory>
+ </configuration>
+</execution>
+```
+
+
+4. In the root directory of the IoTDB source code folder,run `mvn clean
generate-sources`,
+
+This command will automatically delete the files in
`iotdb/iotdb-protocol/thrift/target` and
`iotdb/iotdb-protocol/thrift-commons/target`, and repopulate the folder with
the newly generated throttle file.
+
+## Using the Rust native interface
+
+copy `iotdb/iotdb-protocol/thrift/target/generated-sources-rust/` and
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-rust/` in your
project。
+
+
+## rpc interface
+
+```
+// open a session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// close a session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// run an SQL statement in batch
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// execute SQL statement in batch
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// execute query SQL statement
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// execute insert, delete and update SQL statement
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// fetch next query result
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// fetch meta data
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// cancel a query
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// close a query dataset
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// get time zone
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// set time zone
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// get server's properties
+ServerProperties getProperties();
+
+// CREATE DATABASE
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// create timeseries
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// create multi timeseries
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// delete timeseries
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// delete sttorage groups
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// insert record
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// insert record in string format
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// insert tablet
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// insert tablets in batch
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// insert records in batch
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// insert records of one device
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// insert records in batch as string format
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// test the latency of innsert tablet,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// test the latency of innsert tablets,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// test the latency of innsert record,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// test the latency of innsert record in string format,caution:no data will be
inserted, only for test latency
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// test the latency of innsert records,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// test the latency of innsert records of one device,caution:no data will be
inserted, only for test latency
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// test the latency of innsert records in string formate,caution:no data will
be inserted, only for test latency
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// delete data
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// execute raw data query
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// request a statement id from server
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git a/src/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
b/src/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
index 1bb0a5a..354ed74 100644
--- a/src/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
+++ b/src/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
@@ -29,7 +29,7 @@
</dependency>
```
-Here are some
[examples](https://github.com/apache/iotdb/blob/master/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
of connecting IoTDB using the InfluxDB-Protocol adapter.
+Here are some
[examples](https://github.com/apache/iotdb/blob/rel/1.1/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
of connecting IoTDB using the InfluxDB-Protocol adapter.
## 1. Switching Scheme
diff --git a/src/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
b/src/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
new file mode 100644
index 0000000..c18db2a
--- /dev/null
+++ b/src/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
@@ -0,0 +1,213 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# C# Native API
+
+## Installation
+
+### Install from NuGet Package
+
+We have prepared Nuget Package for C# users. Users can directly install the
client through .NET CLI. [The link of our NuGet Package is
here](https://www.nuget.org/packages/Apache.IoTDB/). Run the following command
in the command line to complete installation
+
+```sh
+dotnet add package Apache.IoTDB
+```
+
+Note that the `Apache.IoTDB` package only supports versions greater than `.net
framework 4.6.1`.
+
+## Prerequisites
+
+ .NET SDK Version >= 5.0
+ .NET Framework >= 4.6.1
+
+## How to Use the Client (Quick Start)
+
+Users can quickly get started by referring to the use cases under the
Apache-IoTDB-Client-CSharp-UserCase directory. These use cases serve as a
useful resource for getting familiar with the client's functionality and
capabilities.
+
+For those who wish to delve deeper into the client's usage and explore more
advanced features, the samples directory contains additional code samples.
+
+## Developer environment requirements for iotdb-client-csharp
+
+```
+.NET SDK Version >= 5.0
+.NET Framework >= 4.6.1
+ApacheThrift >= 0.14.1
+NLog >= 4.7.9
+```
+
+### OS
+
+* Linux, Macos or other unix-like OS
+* Windows+bash(WSL, cygwin, Git Bash)
+
+### Command Line Tools
+
+* dotnet CLI
+* Thrift
+
+## Basic interface description
+
+The Session interface is semantically identical to other language clients
+
+```csharp
+// Parameters
+string host = "localhost";
+int port = 6667;
+int pool_size = 2;
+
+// Init Session
+var session_pool = new SessionPool(host, port, pool_size);
+
+// Open Session
+await session_pool.Open(false);
+
+// Create TimeSeries
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts1",
TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts2",
TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts3",
TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+
+// Insert Record
+var measures = new List<string>{"ts1", "ts2", "ts3"};
+var values = new List<object> { "test_text", true, (int)123 };
+var timestamp = 1;
+var rowRecord = new RowRecord(timestamp, values, measures);
+await session_pool.InsertRecordAsync("root.test_group.test_device", rowRecord);
+
+// Insert Tablet
+var timestamp_lst = new List<long>{ timestamp + 1 };
+var value_lst = new List<object> {new() {"iotdb", true, (int) 12}};
+var tablet = new Tablet("root.test_group.test_device", measures, value_lst,
timestamp_ls);
+await session_pool.InsertTabletAsync(tablet);
+
+// Close Session
+await session_pool.Close();
+```
+
+## **Row Record**
+
+- Encapsulate and abstract the `record` data in **IoTDB**
+- e.g.
+
+| timestamp | status | temperature |
+| --------- | ------ | ----------- |
+| 1 | 0 | 20 |
+
+- Construction:
+
+```csharp
+var rowRecord =
+ new RowRecord(long timestamps, List<object> values, List<string>
measurements);
+```
+
+### **Tablet**
+
+- A data structure similar to a table, containing several non empty data
blocks of a device's rows。
+- e.g.
+
+| time | status | temperature |
+| ---- | ------ | ----------- |
+| 1 | 0 | 20 |
+| 2 | 0 | 20 |
+| 3 | 3 | 21 |
+
+- Construction:
+
+```csharp
+var tablet =
+ Tablet(string deviceId, List<string> measurements, List<List<object>>
values, List<long> timestamps);
+```
+
+
+
+## **API**
+
+### **Basic API**
+
+| api name | parameters | notes | use
example |
+| -------------- | ------------------------- | ------------------------ |
----------------------------- |
+| Open | bool | open session |
session_pool.Open(false) |
+| Close | null | close session |
session_pool.Close() |
+| IsOpen | null | check if session is open |
session_pool.IsOpen() |
+| OpenDebugMode | LoggingConfiguration=null | open debug mode |
session_pool.OpenDebugMode() |
+| CloseDebugMode | null | close debug mode |
session_pool.CloseDebugMode() |
+| SetTimeZone | string | set time zone |
session_pool.GetTimeZone() |
+| GetTimeZone | null | get time zone |
session_pool.GetTimeZone() |
+
+### **Record API**
+
+| api name | parameters | notes
| use example
|
+| ----------------------------------- | ----------------------------- |
----------------------------------- |
------------------------------------------------------------ |
+| InsertRecordAsync | string, RowRecord | insert
single record |
session_pool.InsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
new RowRecord(1, values, measures)); |
+| InsertRecordsAsync | List\<string\>, List\<RowRecord\> |
insert records |
session_pool.InsertRecordsAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceAsync | string, List\<RowRecord\> |
insert records of one device |
session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceSortedAsync | string, List\<RowRecord\> |
insert sorted records of one device |
InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); |
+| TestInsertRecordAsync | string, RowRecord | test
insert record |
session_pool.TestInsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
rowRecord) |
+| TestInsertRecordsAsync | List\<string\>, List\<RowRecord\> |
test insert record |
session_pool.TestInsertRecordsAsync(device_id, rowRecords) |
+
+### **Tablet API**
+
+| api name | parameters | notes | use example
|
+| ---------------------- | ------------ | -------------------- |
-------------------------------------------- |
+| InsertTabletAsync | Tablet | insert single tablet |
session_pool.InsertTabletAsync(tablet) |
+| InsertTabletsAsync | List\<Tablet\> | insert tablets |
session_pool.InsertTabletsAsync(tablets) |
+| TestInsertTabletAsync | Tablet | test insert tablet |
session_pool.TestInsertTabletAsync(tablet) |
+| TestInsertTabletsAsync | List\<Tablet\> | test insert tablets |
session_pool.TestInsertTabletsAsync(tablets) |
+
+### **SQL API**
+
+| api name | parameters | notes
| use example |
+| ----------------------------- | ---------- | ------------------------------
| ------------------------------------------------------------ |
+| ExecuteQueryStatementAsync | string | execute sql query statement
| session_pool.ExecuteQueryStatementAsync("select * from
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE where time<15"); |
+| ExecuteNonQueryStatementAsync | string | execute sql nonquery statement
| session_pool.ExecuteNonQueryStatementAsync( "create timeseries
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.status with
datatype=BOOLEAN,encoding=PLAIN") |
+
+### **Scheam API**
+
+| api name | parameters
| notes | use example
|
+| -------------------------- |
------------------------------------------------------------ |
--------------------------- |
------------------------------------------------------------ |
+| SetStorageGroup | string
| set storage group |
session_pool.SetStorageGroup("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| CreateTimeSeries | string, TSDataType, TSEncoding, Compressor
| create time series |
session_pool.InsertTabletsAsync(tablets) |
+| DeleteStorageGroupAsync | string
| delete single storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| DeleteStorageGroupsAsync | List\<string\>
| delete storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP") |
+| CreateMultiTimeSeriesAsync | List\<string\>, List\<TSDataType\> ,
List\<TSEncoding\> , List\<Compressor\> | create multi time series |
session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst,
encoding_lst, compressor_lst); |
+| DeleteTimeSeriesAsync | List\<string\>
| delete time series |
|
+| DeleteTimeSeriesAsync | string
| delete time series |
|
+| DeleteDataAsync | List\<string\>, long, long
| delete data |
session_pool.DeleteDataAsync(ts_path_lst, 2, 3) |
+
+### **Other API**
+
+| api name | parameters | notes | use
example |
+| -------------------------- | ---------- | --------------------------- |
---------------------------------------------------- |
+| CheckTimeSeriesExistsAsync | string | check if time series exists |
session_pool.CheckTimeSeriesExistsAsync(time series) |
+
+
+
+[e.g.](https://github.com/apache/iotdb-client-csharp/tree/main/samples/Apache.IoTDB.Samples)
+
+## SessionPool
+
+To implement concurrent client requests, we provide a `SessionPool` for the
native interface. Since `SessionPool` itself is a superset of `Session`, when
`SessionPool` is a When the `pool_size` parameter is set to 1, it reverts to
the original `Session`
+
+We use the `ConcurrentQueue` data structure to encapsulate a client queue to
maintain multiple connections with the server. When the `Open()` interface is
called, a specified number of clients are created in the queue, and synchronous
access to the queue is achieved through the `System.Threading.Monitor` class.
+
+When a request occurs, it will try to find an idle client connection from the
Connection pool. If there is no idle connection, the program will need to wait
until there is an idle connection
+
+When a connection is used up, it will automatically return to the pool and
wait for the next time it is used up
+
diff --git a/src/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
b/src/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
new file mode 100644
index 0000000..cae3f91
--- /dev/null
+++ b/src/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
@@ -0,0 +1,196 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Node.js Native API
+
+IoTDB uses Thrift as a cross language RPC framework, so access to IoTDB can be
achieved through the interface provided by Thrift. This document will introduce
how to generate a native Node.js interface that can access IoTDB.
+
+## Dependents
+
+ * JDK >= 1.8
+ * Node.js >= 16.0.0
+ * thrift 0.14.1
+ * Linux、Macos or like unix
+ * Windows+bash
+
+Thrift (0.14.1 or higher) must be installed to compile Thrift files into
Node.js code. The following is the official installation tutorial, and in the
end, you should receive a Thrift executable file.
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## Compile the Thrift library and generate the Node.js native interface
+
+1. Find the pom.xml file in the root directory of the IoTDB source code folder.
+2. Open the pom.xml file and find the following content:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. Referring to this setting, add the following content to the pom.xml file to
generate the native interface for Node.js:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-nodejs</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>js:node</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-nodejs</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. In the root directory of the IoTDB source code folder,run `mvn clean
generate-sources`,
+
+This command will automatically delete the files in
`iotdb/iotdb-protocol/thrift/target` and
`iotdb/iotdb-protocol/thrift-commons/target`, and repopulate the folder with
the newly generated throttle file.
+
+
+## Using the Node.js native interface
+
+copy `iotdb/iotdb-protocol/thrift/target/generated-sources-nodejs/` and
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-nodejs/` in your
project。
+
+
+## rpc interface
+
+```
+// open a session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// close a session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// run an SQL statement in batch
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// execute SQL statement in batch
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// execute query SQL statement
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// execute insert, delete and update SQL statement
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// fetch next query result
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// fetch meta data
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// cancel a query
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// close a query dataset
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// get time zone
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// set time zone
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// get server's properties
+ServerProperties getProperties();
+
+// CREATE DATABASE
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// create timeseries
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// create multi timeseries
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// delete timeseries
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// delete sttorage groups
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// insert record
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// insert record in string format
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// insert tablet
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// insert tablets in batch
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// insert records in batch
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// insert records of one device
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// insert records in batch as string format
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// test the latency of innsert tablet,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// test the latency of innsert tablets,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// test the latency of innsert record,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// test the latency of innsert record in string format,caution:no data will be
inserted, only for test latency
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// test the latency of innsert records,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// test the latency of innsert records of one device,caution:no data will be
inserted, only for test latency
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// test the latency of innsert records in string formate,caution:no data will
be inserted, only for test latency
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// delete data
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// execute raw data query
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// request a statement id from server
+i64 requestStatementId(1:i64 sessionId);
+```
\ No newline at end of file
diff --git a/src/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
b/src/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
new file mode 100644
index 0000000..a5bbacf
--- /dev/null
+++ b/src/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
@@ -0,0 +1,198 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Rust Native API Native API
+
+IoTDB uses Thrift as a cross language RPC framework, so access to IoTDB can be
achieved through the interface provided by Thrift. This document will introduce
how to generate a native Rust interface that can access IoTDB.
+
+
+## Dependents
+
+ * JDK >= 1.8
+ * Rust >= 1.0.0
+ * thrift 0.14.1
+ * Linux、Macos or like unix
+ * Windows+bash
+
+Thrift (0.14.1 or higher) must be installed to compile Thrift files into Rust
code. The following is the official installation tutorial, and in the end, you
should receive a Thrift executable file.
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## Compile the Thrift library and generate the Rust native interface
+
+1. Find the pom.xml file in the root directory of the IoTDB source code folder.
+2. Open the pom.xml file and find the following content:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. Referring to this setting, add the following content to the pom.xml file to
generate the native interface for Rust:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-rust</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>rs</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-rust</outputDirectory>
+ </configuration>
+</execution>
+```
+
+
+4. In the root directory of the IoTDB source code folder,run `mvn clean
generate-sources`,
+
+This command will automatically delete the files in
`iotdb/iotdb-protocol/thrift/target` and
`iotdb/iotdb-protocol/thrift-commons/target`, and repopulate the folder with
the newly generated throttle file.
+
+## Using the Rust native interface
+
+copy `iotdb/iotdb-protocol/thrift/target/generated-sources-rust/` and
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-rust/` in your
project。
+
+
+## rpc interface
+
+```
+// open a session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// close a session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// run an SQL statement in batch
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// execute SQL statement in batch
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// execute query SQL statement
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// execute insert, delete and update SQL statement
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// fetch next query result
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// fetch meta data
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// cancel a query
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// close a query dataset
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// get time zone
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// set time zone
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// get server's properties
+ServerProperties getProperties();
+
+// CREATE DATABASE
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// create timeseries
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// create multi timeseries
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// delete timeseries
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// delete sttorage groups
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// insert record
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// insert record in string format
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// insert tablet
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// insert tablets in batch
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// insert records in batch
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// insert records of one device
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// insert records in batch as string format
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// test the latency of innsert tablet,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// test the latency of innsert tablets,caution:no data will be inserted, only
for test latency
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// test the latency of innsert record,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// test the latency of innsert record in string format,caution:no data will be
inserted, only for test latency
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// test the latency of innsert records,caution:no data will be inserted, only
for test latency
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// test the latency of innsert records of one device,caution:no data will be
inserted, only for test latency
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// test the latency of innsert records in string formate,caution:no data will
be inserted, only for test latency
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// delete data
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// execute raw data query
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// request a statement id from server
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
b/src/zh/UserGuide/Master/API/InfluxDB-Protocol.md
similarity index 99%
copy from src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
copy to src/zh/UserGuide/Master/API/InfluxDB-Protocol.md
index 989ddd4..e10cb1b 100644
--- a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
+++ b/src/zh/UserGuide/Master/API/InfluxDB-Protocol.md
@@ -29,7 +29,7 @@
</dependency>
```
-这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/master/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
+这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/rel/1.1/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
## 1.切换方案
diff --git a/src/zh/UserGuide/Master/API/Programming-CSharp-Native-API.md
b/src/zh/UserGuide/Master/API/Programming-CSharp-Native-API.md
new file mode 100644
index 0000000..ab1ebeb
--- /dev/null
+++ b/src/zh/UserGuide/Master/API/Programming-CSharp-Native-API.md
@@ -0,0 +1,274 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# C# 原生接口
+
+## 依赖
+
+- .NET SDK >= 5.0 或 .NET Framework 4.x
+- Thrift >= 0.14.1
+- NLog >= 4.7.9
+
+## 安装
+
+您可以使用 NuGet Package Manager, .NET CLI等工具来安装,以 .NET CLI为例
+
+如果您使用的是.NET 5.0 或者更高版本的SDK,输入如下命令即可安装最新的NuGet包
+
+```
+dotnet add package Apache.IoTDB
+```
+
+为了适配 .NET Framework 4.x,我们单独构建了一个NuGet包,如果您使用的是.NET Framework
4.x,输入如下命令即可安装最新的包
+
+```bash
+dotnet add package Apache.IoTDB.framework
+```
+
+如果您想安装更早版本的客户端,只需要指定版本即可
+
+```bash
+# 安装0.12.1.2版本的客户端
+dotnet add package Apache.IoTDB --version 0.12.1.2
+```
+
+## 基本接口说明
+
+Session接口在语义上和其他语言客户端相同
+
+```csharp
+// 参数定义
+string host = "localhost";
+int port = 6667;
+int pool_size = 2;
+
+// 初始化session
+var session_pool = new SessionPool(host, port, pool_size);
+
+// 开启session
+await session_pool.Open(false);
+
+// 创建时间序列
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts1",
TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts2",
TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts3",
TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+
+// 插入record
+var measures = new List<string>{"ts1", "ts2", "ts3"};
+var values = new List<object> { "test_text", true, (int)123 };
+var timestamp = 1;
+var rowRecord = new RowRecord(timestamp, values, measures);
+await session_pool.InsertRecordAsync("root.test_group.test_device", rowRecord);
+
+// 插入Tablet
+var timestamp_lst = new List<long>{ timestamp + 1 };
+var value_lst = new List<object> {new() {"iotdb", true, (int) 12}};
+var tablet = new Tablet("root.test_group.test_device", measures, value_lst,
timestamp_ls);
+await session_pool.InsertTabletAsync(tablet);
+
+// 关闭Session
+await session_pool.Close();
+```
+
+## **Row Record**
+
+- 对**IoTDB**中的`record`数据进行封装和抽象。
+- 示例:
+
+| timestamp | status | temperature |
+| --------- | ------ | ----------- |
+| 1 | 0 | 20 |
+
+- 构造方法:
+
+```csharp
+var rowRecord =
+ new RowRecord(long timestamps, List<object> values, List<string>
measurements);
+```
+
+### **Tablet**
+
+- 一种类似于表格的数据结构,包含一个设备的若干行非空数据块。
+- 示例:
+
+| time | status | temperature |
+| ---- | ------ | ----------- |
+| 1 | 0 | 20 |
+| 2 | 0 | 20 |
+| 3 | 3 | 21 |
+
+- 构造方法:
+
+```csharp
+var tablet =
+ Tablet(string deviceId, List<string> measurements, List<List<object>>
values, List<long> timestamps);
+```
+
+
+
+## **API**
+
+### **基础接口**
+
+| api name | parameters | notes | use
example |
+| -------------- | ------------------------- | ------------------------ |
----------------------------- |
+| Open | bool | open session |
session_pool.Open(false) |
+| Close | null | close session |
session_pool.Close() |
+| IsOpen | null | check if session is open |
session_pool.IsOpen() |
+| OpenDebugMode | LoggingConfiguration=null | open debug mode |
session_pool.OpenDebugMode() |
+| CloseDebugMode | null | close debug mode |
session_pool.CloseDebugMode() |
+| SetTimeZone | string | set time zone |
session_pool.GetTimeZone() |
+| GetTimeZone | null | get time zone |
session_pool.GetTimeZone() |
+
+### **Record相关接口**
+
+| api name | parameters | notes
| use example
|
+| ----------------------------------- | ----------------------------- |
----------------------------------- |
------------------------------------------------------------ |
+| InsertRecordAsync | string, RowRecord | insert
single record |
session_pool.InsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
new RowRecord(1, values, measures)); |
+| InsertRecordsAsync | List\<string\>, List\<RowRecord\> |
insert records |
session_pool.InsertRecordsAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceAsync | string, List\<RowRecord\> |
insert records of one device |
session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceSortedAsync | string, List\<RowRecord\> |
insert sorted records of one device |
InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); |
+| TestInsertRecordAsync | string, RowRecord | test
insert record |
session_pool.TestInsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
rowRecord) |
+| TestInsertRecordsAsync | List\<string\>, List\<RowRecord\> |
test insert record |
session_pool.TestInsertRecordsAsync(device_id, rowRecords) |
+
+### **Tablet相关接口**
+
+| api name | parameters | notes | use example
|
+| ---------------------- | ------------ | -------------------- |
-------------------------------------------- |
+| InsertTabletAsync | Tablet | insert single tablet |
session_pool.InsertTabletAsync(tablet) |
+| InsertTabletsAsync | List\<Tablet\> | insert tablets |
session_pool.InsertTabletsAsync(tablets) |
+| TestInsertTabletAsync | Tablet | test insert tablet |
session_pool.TestInsertTabletAsync(tablet) |
+| TestInsertTabletsAsync | List\<Tablet\> | test insert tablets |
session_pool.TestInsertTabletsAsync(tablets) |
+
+### **SQL语句接口**
+
+| api name | parameters | notes
| use example |
+| ----------------------------- | ---------- | ------------------------------
| ------------------------------------------------------------ |
+| ExecuteQueryStatementAsync | string | execute sql query statement
| session_pool.ExecuteQueryStatementAsync("select * from
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE where time<15"); |
+| ExecuteNonQueryStatementAsync | string | execute sql nonquery statement
| session_pool.ExecuteNonQueryStatementAsync( "create timeseries
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.status with
datatype=BOOLEAN,encoding=PLAIN") |
+
+### 数据表接口
+
+| api name | parameters
| notes | use example
|
+| -------------------------- |
------------------------------------------------------------ |
--------------------------- |
------------------------------------------------------------ |
+| SetStorageGroup | string
| set storage group |
session_pool.SetStorageGroup("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| CreateTimeSeries | string, TSDataType, TSEncoding, Compressor
| create time series |
session_pool.InsertTabletsAsync(tablets) |
+| DeleteStorageGroupAsync | string
| delete single storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| DeleteStorageGroupsAsync | List\<string\>
| delete storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP") |
+| CreateMultiTimeSeriesAsync | List\<string\>, List\<TSDataType\> ,
List\<TSEncoding\> , List\<Compressor\> | create multi time series |
session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst,
encoding_lst, compressor_lst); |
+| DeleteTimeSeriesAsync | List\<string\>
| delete time series |
|
+| DeleteTimeSeriesAsync | string
| delete time series |
|
+| DeleteDataAsync | List\<string\>, long, long
| delete data |
session_pool.DeleteDataAsync(ts_path_lst, 2, 3) |
+
+### **辅助接口**
+
+| api name | parameters | notes | use
example |
+| -------------------------- | ---------- | --------------------------- |
---------------------------------------------------- |
+| CheckTimeSeriesExistsAsync | string | check if time series exists |
session_pool.CheckTimeSeriesExistsAsync(time series) |
+
+
+
+用法可以参考[用户示例](https://github.com/apache/iotdb-client-csharp/tree/main/samples/Apache.IoTDB.Samples)
+
+## 连接池
+
+为了实现并发客户端请求,我们提供了针对原生接口的连接池(`SessionPool`),由于`SessionPool`本身为`Session`的超集,当`SessionPool`的`pool_size`参数设置为1时,退化为原来的`Session`
+
+我们使用`ConcurrentQueue`数据结构封装了一个客户端队列,以维护与服务端的多个连接,当调用`Open()`接口时,会在该队列中创建指定个数的客户端,同时通过`System.Threading.Monitor`类实现对队列的同步访问。
+
+当请求发生时,会尝试从连接池中寻找一个空闲的客户端连接,如果没有空闲连接,那么程序将需要等待直到有空闲连接
+
+当一个连接被用完后,他会自动返回池中等待下次被使用
+
+## ByteBuffer
+
+在传入RPC接口参数时,需要对Record和Tablet两种数据结构进行序列化,我们主要通过封装的ByteBuffer类实现
+
+在封装字节序列的基础上,我们进行了内存预申请与内存倍增的优化,减少了序列化过程中内存的申请和释放,在一个拥有20000行的Tablet上进行序列化测试时,速度比起原生的数组动态增长具有**35倍的性能加速**
+
+### 实现介绍
+在进行`RowRecords`以及`Tablet`的插入时,我们需要对多行RowRecord和Tablet进行序列化以进行发送。客户端中的序列化实现主要依赖于ByteBuffer完成。接下来我们介绍ByteBuffer的实现细节。本文包含如下几点内容:
+ - 序列化的协议
+ - C#与Java的大小端的差异
+ - ByteBuffer内存倍增算法
+
+### 序列化协议
+客户端向IoTDB服务器发送的序列化数据总体应该包含两个信息。
+ - 数据类型
+ - 数据本身
+
+其中对于`字符串`的序列化时,我们需要再加入字符串的长度信息。即一个字符串的序列化完整结果为:
+
+ [类型][长度][数据内容]
+接下来我们分别介绍`RowRecord`、`Tablet`的序列化方式
+
+#### RowRecord
+我们对RowRecord进行序列化时,`伪代码`如下:
+```csharp
+public byte[] value_to_bytes(List<TSDataType> data_types, List<string> values){
+ ByteBuffer buffer = new ByteBuffer(values.Count);
+ for(int i = 0;i < data_types.Count(); i++){
+ buffer.add_type((data_types[i]);
+ buffer.add_val(values[i]);
+ }
+}
+```
+
+对于其序列化的结果格式如下:
+
+ [数据类型1][数据1][数据类型2][数据2]...[数据类型N][数据N]
+ 其中数据类型为自定义的`Enum`变量,分别如下:
+```csharp
+public enum TSDataType{BOOLEAN, INT32, INT64, FLOAT, DOUBLE, TEXT, NONE};
+```
+
+#### Tablet序列化
+使用`Tabelt`进行数据插入时有如下限制:
+
+ 限制:Tablet中数据不能有空值
+由于向 `IoTDB`服务器发送`Tablet`数据插入请求时会携带`行数`, `列数`,
`列数据类型`,所以`Tabelt`序列化时我们不需要加入数据类型信息。`Tablet`是`按照列进行序列化`,这是因为后端可以通过行数得知出当前列的元素个数,同时根据列类型来对数据进行解析。
+
+### CSharp与Java序列化数据时的大小端差异
+由于Java序列化默认大端协议,而CSharp序列化默认得到小端序列。所以我们在CSharp中序列化数据之后,需要对数据进行反转这样后端才可以正常解析。同时当我们从后端获取到序列化的结果时(如`SessionDataset`),我们也需要对获得的数据进行反转以解析内容。这其中特例便是字符串的序列化,CSharp中对字符串的序列化结果为大端序,所以序列化字符串或者接收到字符串序列化结果时,不需要反转序列结果。
+
+### ByteBuffer内存倍增法
+拥有数万行的Tablet的序列化结果可能有上百兆,为了能够高效的实现大`Tablet`的序列化,我们对ByteBuffer使用`内存倍增法`的策略来减少序列化过程中对于内存的申请和释放。即当当前的buffer的长度不足以放下序列化结果时,我们将当前buffer的内存`至少`扩增2倍。这极大的减少了内存的申请释放次数,加速了大Tablet的序列化速度。
+```csharp
+private void extend_buffer(int space_need){
+ if(write_pos + space_need >= total_length){
+ total_length = max(space_need, total_length);
+ byte[] new_buffer = new byte[total_length * 2];
+ buffer.CopyTo(new_buffer, 0);
+ buffer = new_buffer;
+ total_length = 2 * total_length;
+ }
+}
+```
+同时在序列化`Tablet`时,我们首先根据Tablet的`行数`,`列数`以及每一列的数据类型估计当前`Tablet`序列化结果所需要的内存大小,并在初始化时进行内存的申请。这进一步的减少了内存的申请释放频率。
+
+通过上述的策略,我们在一个有`20000`行的Tablet上进行测试时,序列化速度相比Naive数组长度动态生长实现算法具有约35倍的性能加速。
+
+## 异常重连
+
+当服务端发生异常或者宕机重启时,客户端中原来通过`Open()`产生的的session会失效,抛出`TException`异常
+
+为了避免这一情况的发生,我们对大部分的接口进行了增强,一旦出现连接问题,就会尝试重新调用`Open()`接口并创建新的Session,并尝试重新发送对应的请求
+
diff --git a/src/zh/UserGuide/Master/API/Programming-NodeJS-Native-API.md
b/src/zh/UserGuide/Master/API/Programming-NodeJS-Native-API.md
new file mode 100644
index 0000000..3bd4e13
--- /dev/null
+++ b/src/zh/UserGuide/Master/API/Programming-NodeJS-Native-API.md
@@ -0,0 +1,201 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Node.js 原生接口
+
+IoTDB 使用 Thrift 作为跨语言的 RPC 框架,因此可以通过 Thrift 提供的接口来实现对 IoTDB 的访问。本文档将介绍如何生成可访问
IoTDB 的原生 Node.js 接口。
+
+
+## 依赖
+
+ * JDK >= 1.8
+ * Node.js >= 16.0.0
+ * thrift 0.14.1
+ * Linux、Macos 或其他类 unix 系统
+ * Windows+bash (下载 IoTDB Go client 需要 git ,通过 WSL、cygwin、Git Bash 任意一种方式均可)
+
+必须安装 thrift(0.14.1 或更高版本)才能将 thrift 文件编译为 Node.js 代码。下面是官方的安装教程,最终,您应该得到一个
thrift 可执行文件。
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## 编译 thrift 库,生成 Node.js 原生接口
+
+1. 在 IoTDB 源代码文件夹的根目录中找到 pom.xml 文件。
+2. 打开 pom.xml 文件,找到以下内容:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. 参考该设置,在 pom.xml 文件中添加以下内容,用来生成 Node.js 的原生接口:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-nodejs</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>js:node</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-nodejs</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. 在 IoTDB 源代码文件夹的根目录下,运行`mvn clean generate-sources`,
+
+这个指令将自动删除`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`中的文件,并使用新生成的 thrift 文件重新填充该文件夹。
+
+这个文件夹在 git 中会被忽略,并且**永远不应该被推到 git 中!**
+
+**注意**不要将`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`上传到 git 仓库中 !
+
+## 使用 Node.js 原生接口
+
+将 `iotdb/iotdb-protocol/thrift/target/generated-sources-nodejs/` 和
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-nodejs/`
中的文件复制到您的项目中,即可使用。
+
+
+## 支持的 rpc 接口
+
+```
+// 打开一个 session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// 关闭一个 session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// 执行一条 SQL 语句
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// 批量执行 SQL 语句
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// 执行查询 SQL 语句
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// 执行插入、删除 SQL 语句
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// 向服务器取下一批查询结果
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// 获取元数据
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// 取消某次查询操作
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// 关闭查询操作数据集,释放资源
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// 获取时区信息
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// 设置时区
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// 获取服务端配置
+ServerProperties getProperties();
+
+// 设置 database
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// 创建时间序列
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// 创建多条时间序列
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// 删除时间序列
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// 删除 database
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// 按行插入数据
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// 按 String 格式插入一条数据
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// 按列插入数据
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// 按列批量插入数据
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// 按行批量插入数据
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// 按行批量插入同属于某个设备的数据
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 按 String 格式批量按行插入数据
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 测试按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// 测试批量按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// 测试按 String 格式按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// 测试按行批量插入同属于某个设备的数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 测试按 String 格式批量按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 删除数据
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// 执行原始数据查询
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// 向服务器申请一个查询语句 ID
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git a/src/zh/UserGuide/Master/API/Programming-Rust-Native-API.md
b/src/zh/UserGuide/Master/API/Programming-Rust-Native-API.md
new file mode 100644
index 0000000..d757105
--- /dev/null
+++ b/src/zh/UserGuide/Master/API/Programming-Rust-Native-API.md
@@ -0,0 +1,200 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Rust 原生接口
+
+IoTDB 使用 Thrift 作为跨语言的 RPC 框架,因此可以通过 Thrift 提供的接口来实现对 IoTDB 的访问。本文档将介绍如何生成可访问
IoTDB 的原生 Rust 接口。
+
+
+## 依赖
+
+ * JDK >= 1.8
+ * Rust >= 1.0.0
+ * thrift 0.14.1
+ * Linux、Macos 或其他类 unix 系统
+ * Windows+bash (下载 IoTDB Go client 需要 git ,通过 WSL、cygwin、Git Bash 任意一种方式均可)
+
+必须安装 thrift(0.14.1 或更高版本)才能将 thrift 文件编译为 Rust 代码。下面是官方的安装教程,最终,您应该得到一个 thrift
可执行文件。
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## 编译 thrift 库,生成 Rust 原生接口
+
+1. 在 IoTDB 源代码文件夹的根目录中找到 pom.xml 文件。
+2. 打开 pom.xml 文件,找到以下内容:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. 参考该设置,在 pom.xml 文件中添加以下内容,用来生成 Rust 的原生接口:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-rust</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>rs</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-rust</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. 在 IoTDB 源代码文件夹的根目录下,运行`mvn clean generate-sources`,
+
+这个指令将自动删除`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`中的文件,并使用新生成的 thrift 文件重新填充该文件夹。
+
+这个文件夹在 git 中会被忽略,并且**永远不应该被推到 git 中!**
+
+**注意**不要将`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`上传到 git 仓库中 !
+
+## 使用 Rust 原生接口
+
+将 `iotdb/iotdb-protocol/thrift/target/generated-sources-rust/` 和
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-rust/`
中的文件复制到您的项目中,即可使用。
+
+## 支持的 rpc 接口
+
+```
+// 打开一个 session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// 关闭一个 session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// 执行一条 SQL 语句
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// 批量执行 SQL 语句
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// 执行查询 SQL 语句
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// 执行插入、删除 SQL 语句
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// 向服务器取下一批查询结果
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// 获取元数据
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// 取消某次查询操作
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// 关闭查询操作数据集,释放资源
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// 获取时区信息
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// 设置时区
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// 获取服务端配置
+ServerProperties getProperties();
+
+// 设置 database
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// 创建时间序列
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// 创建多条时间序列
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// 删除时间序列
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// 删除 database
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// 按行插入数据
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// 按 String 格式插入一条数据
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// 按列插入数据
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// 按列批量插入数据
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// 按行批量插入数据
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// 按行批量插入同属于某个设备的数据
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 按 String 格式批量按行插入数据
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 测试按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// 测试批量按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// 测试按 String 格式按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// 测试按行批量插入同属于某个设备的数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 测试按 String 格式批量按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 删除数据
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// 执行原始数据查询
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// 向服务器申请一个查询语句 ID
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git
a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md
b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md
index 19880f7..f94180f 100644
---
a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md
+++
b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Deployment-Guide_timecho.md
@@ -76,7 +76,7 @@ Windows 系统启动命令如下:
### 集群管理工具部署
-IoTDB集群管理工具是一款超级易用的 Apache IoTDB 集群部署工具。本文档将说明如何用集群管理工具如何远程部署、配置、启动和停止 Apache
IoTDB 集群实例。关于集群管理工具的更多信息请点击:
[集群管理工具](../Tools-System/Maintenance-Tool.md##集群管理工具)
+IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB
分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止
IoTDB 集群实例。
#### 部署集群管理工具
@@ -88,9 +88,9 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat
##### 部署方法
-###### 方案一 二进制包下载安装
+###### 下载安装
-目前二进制文件仅支持linux 和mac
操作系统,二进制文件下载地址:https://github.com/TimechoLab/iotdb-deploy/releases
+本工具为IoTDB企业版配套工具,您可以联系您的销售获取工具下载方式。
注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本
@@ -112,30 +112,6 @@ iotd cluster check example
<iotd absolute path>/sbin/iotd cluster check example
```
-###### 方案二 源码包下载安装
-
-源码包执行需要依赖python3.8及以上版本
-
-* 执行如下命令下载源码包
-
-```bash
-git clone https://github.com/TimechoLab/iotdb-deploy.git
-```
-
-* 在iotd-deploy目录内输入以下指令后:
-
-```bash
-bash install.sh
-```
-
-即可在之后的 shell 内激活 iotd 关键词,并安装所需的 whl 包。注意下载的iotd-deploy不要放在包含空格的目录下面,防止无法使用。
-
-* 如果要在该 shell 内立刻激活该关键词,需要执行:
-
-```bash
-alias "iotd=python3 <main.py's absolute path>"
-```
-
#### 集群配置文件介绍
* 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml
文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。
diff --git a/src/zh/UserGuide/Master/Tools-System/Maintenance-Tool_timecho.md
b/src/zh/UserGuide/Master/Tools-System/Maintenance-Tool_timecho.md
index 3c138fa..bfe1d84 100644
--- a/src/zh/UserGuide/Master/Tools-System/Maintenance-Tool_timecho.md
+++ b/src/zh/UserGuide/Master/Tools-System/Maintenance-Tool_timecho.md
@@ -25,7 +25,7 @@
### 集群管理工具部署
-IoTDB集群管理工具是一款超级易用的 Apache IoTDB 集群部署工具。本文档将说明如何用集群管理工具如何远程部署、配置、启动和停止 Apache
IoTDB 集群实例。关于集群管理工具的更多信息请点击:
[集群管理工具](../Tools-System/Maintenance-Tool.md##集群管理工具)
+IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB
分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止
IoTDB 集群实例。
#### 部署集群管理工具
@@ -37,9 +37,9 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat
##### 部署方法
-###### 方案一 二进制包下载安装
+###### 下载安装
-目前二进制文件仅支持linux 和mac
操作系统,二进制文件下载地址:https://github.com/TimechoLab/iotdb-deploy/releases
+本工具为IoTDB企业版配套工具,您可以联系您的销售获取工具下载方式。
注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本
@@ -61,30 +61,6 @@ iotd cluster check example
<iotd absolute path>/sbin/iotd cluster check example
```
-###### 方案二 源码包下载安装
-
-源码包执行需要依赖python3.8及以上版本
-
-* 执行如下命令下载源码包
-
-```bash
-git clone https://github.com/TimechoLab/iotdb-deploy.git
-```
-
-* 在iotd-deploy目录内输入以下指令后:
-
-```bash
-bash install.sh
-```
-
-即可在之后的 shell 内激活 iotd 关键词,并安装所需的 whl 包。注意下载的iotd-deploy不要放在包含空格的目录下面,防止无法使用。
-
-* 如果要在该 shell 内立刻激活该关键词,需要执行:
-
-```bash
-alias "iotd=python3 <main.py's absolute path>"
-```
-
#### 集群配置文件介绍
* 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml
文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。
diff --git a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
b/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
index 989ddd4..e10cb1b 100644
--- a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
+++ b/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
@@ -29,7 +29,7 @@
</dependency>
```
-这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/master/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
+这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/rel/1.1/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
## 1.切换方案
diff --git a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
b/src/zh/UserGuide/V1.2.x/API/InfluxDB-Protocol.md
similarity index 99%
copy from src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
copy to src/zh/UserGuide/V1.2.x/API/InfluxDB-Protocol.md
index 989ddd4..e10cb1b 100644
--- a/src/zh/UserGuide/V1.1.x/API/InfluxDB-Protocol.md
+++ b/src/zh/UserGuide/V1.2.x/API/InfluxDB-Protocol.md
@@ -29,7 +29,7 @@
</dependency>
```
-这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/master/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
+这里是一些使用 InfluxDB-Protocol 适配器连接 IoTDB
的[示例](https://github.com/apache/iotdb/blob/rel/1.1/example/influxdb-protocol-example/src/main/java/org/apache/iotdb/influxdb/InfluxDBExample.java)
## 1.切换方案
diff --git a/src/zh/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
b/src/zh/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
new file mode 100644
index 0000000..ab1ebeb
--- /dev/null
+++ b/src/zh/UserGuide/V1.2.x/API/Programming-CSharp-Native-API.md
@@ -0,0 +1,274 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# C# 原生接口
+
+## 依赖
+
+- .NET SDK >= 5.0 或 .NET Framework 4.x
+- Thrift >= 0.14.1
+- NLog >= 4.7.9
+
+## 安装
+
+您可以使用 NuGet Package Manager, .NET CLI等工具来安装,以 .NET CLI为例
+
+如果您使用的是.NET 5.0 或者更高版本的SDK,输入如下命令即可安装最新的NuGet包
+
+```
+dotnet add package Apache.IoTDB
+```
+
+为了适配 .NET Framework 4.x,我们单独构建了一个NuGet包,如果您使用的是.NET Framework
4.x,输入如下命令即可安装最新的包
+
+```bash
+dotnet add package Apache.IoTDB.framework
+```
+
+如果您想安装更早版本的客户端,只需要指定版本即可
+
+```bash
+# 安装0.12.1.2版本的客户端
+dotnet add package Apache.IoTDB --version 0.12.1.2
+```
+
+## 基本接口说明
+
+Session接口在语义上和其他语言客户端相同
+
+```csharp
+// 参数定义
+string host = "localhost";
+int port = 6667;
+int pool_size = 2;
+
+// 初始化session
+var session_pool = new SessionPool(host, port, pool_size);
+
+// 开启session
+await session_pool.Open(false);
+
+// 创建时间序列
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts1",
TSDataType.TEXT, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts2",
TSDataType.BOOLEAN, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+await session_pool.CreateTimeSeries("root.test_group.test_device.ts3",
TSDataType.INT32, TSEncoding.PLAIN, Compressor.UNCOMPRESSED);
+
+// 插入record
+var measures = new List<string>{"ts1", "ts2", "ts3"};
+var values = new List<object> { "test_text", true, (int)123 };
+var timestamp = 1;
+var rowRecord = new RowRecord(timestamp, values, measures);
+await session_pool.InsertRecordAsync("root.test_group.test_device", rowRecord);
+
+// 插入Tablet
+var timestamp_lst = new List<long>{ timestamp + 1 };
+var value_lst = new List<object> {new() {"iotdb", true, (int) 12}};
+var tablet = new Tablet("root.test_group.test_device", measures, value_lst,
timestamp_ls);
+await session_pool.InsertTabletAsync(tablet);
+
+// 关闭Session
+await session_pool.Close();
+```
+
+## **Row Record**
+
+- 对**IoTDB**中的`record`数据进行封装和抽象。
+- 示例:
+
+| timestamp | status | temperature |
+| --------- | ------ | ----------- |
+| 1 | 0 | 20 |
+
+- 构造方法:
+
+```csharp
+var rowRecord =
+ new RowRecord(long timestamps, List<object> values, List<string>
measurements);
+```
+
+### **Tablet**
+
+- 一种类似于表格的数据结构,包含一个设备的若干行非空数据块。
+- 示例:
+
+| time | status | temperature |
+| ---- | ------ | ----------- |
+| 1 | 0 | 20 |
+| 2 | 0 | 20 |
+| 3 | 3 | 21 |
+
+- 构造方法:
+
+```csharp
+var tablet =
+ Tablet(string deviceId, List<string> measurements, List<List<object>>
values, List<long> timestamps);
+```
+
+
+
+## **API**
+
+### **基础接口**
+
+| api name | parameters | notes | use
example |
+| -------------- | ------------------------- | ------------------------ |
----------------------------- |
+| Open | bool | open session |
session_pool.Open(false) |
+| Close | null | close session |
session_pool.Close() |
+| IsOpen | null | check if session is open |
session_pool.IsOpen() |
+| OpenDebugMode | LoggingConfiguration=null | open debug mode |
session_pool.OpenDebugMode() |
+| CloseDebugMode | null | close debug mode |
session_pool.CloseDebugMode() |
+| SetTimeZone | string | set time zone |
session_pool.GetTimeZone() |
+| GetTimeZone | null | get time zone |
session_pool.GetTimeZone() |
+
+### **Record相关接口**
+
+| api name | parameters | notes
| use example
|
+| ----------------------------------- | ----------------------------- |
----------------------------------- |
------------------------------------------------------------ |
+| InsertRecordAsync | string, RowRecord | insert
single record |
session_pool.InsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
new RowRecord(1, values, measures)); |
+| InsertRecordsAsync | List\<string\>, List\<RowRecord\> |
insert records |
session_pool.InsertRecordsAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceAsync | string, List\<RowRecord\> |
insert records of one device |
session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords) |
+| InsertRecordsOfOneDeviceSortedAsync | string, List\<RowRecord\> |
insert sorted records of one device |
InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); |
+| TestInsertRecordAsync | string, RowRecord | test
insert record |
session_pool.TestInsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE",
rowRecord) |
+| TestInsertRecordsAsync | List\<string\>, List\<RowRecord\> |
test insert record |
session_pool.TestInsertRecordsAsync(device_id, rowRecords) |
+
+### **Tablet相关接口**
+
+| api name | parameters | notes | use example
|
+| ---------------------- | ------------ | -------------------- |
-------------------------------------------- |
+| InsertTabletAsync | Tablet | insert single tablet |
session_pool.InsertTabletAsync(tablet) |
+| InsertTabletsAsync | List\<Tablet\> | insert tablets |
session_pool.InsertTabletsAsync(tablets) |
+| TestInsertTabletAsync | Tablet | test insert tablet |
session_pool.TestInsertTabletAsync(tablet) |
+| TestInsertTabletsAsync | List\<Tablet\> | test insert tablets |
session_pool.TestInsertTabletsAsync(tablets) |
+
+### **SQL语句接口**
+
+| api name | parameters | notes
| use example |
+| ----------------------------- | ---------- | ------------------------------
| ------------------------------------------------------------ |
+| ExecuteQueryStatementAsync | string | execute sql query statement
| session_pool.ExecuteQueryStatementAsync("select * from
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE where time<15"); |
+| ExecuteNonQueryStatementAsync | string | execute sql nonquery statement
| session_pool.ExecuteNonQueryStatementAsync( "create timeseries
root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.status with
datatype=BOOLEAN,encoding=PLAIN") |
+
+### 数据表接口
+
+| api name | parameters
| notes | use example
|
+| -------------------------- |
------------------------------------------------------------ |
--------------------------- |
------------------------------------------------------------ |
+| SetStorageGroup | string
| set storage group |
session_pool.SetStorageGroup("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| CreateTimeSeries | string, TSDataType, TSEncoding, Compressor
| create time series |
session_pool.InsertTabletsAsync(tablets) |
+| DeleteStorageGroupAsync | string
| delete single storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP_01") |
+| DeleteStorageGroupsAsync | List\<string\>
| delete storage group |
session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP") |
+| CreateMultiTimeSeriesAsync | List\<string\>, List\<TSDataType\> ,
List\<TSEncoding\> , List\<Compressor\> | create multi time series |
session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst,
encoding_lst, compressor_lst); |
+| DeleteTimeSeriesAsync | List\<string\>
| delete time series |
|
+| DeleteTimeSeriesAsync | string
| delete time series |
|
+| DeleteDataAsync | List\<string\>, long, long
| delete data |
session_pool.DeleteDataAsync(ts_path_lst, 2, 3) |
+
+### **辅助接口**
+
+| api name | parameters | notes | use
example |
+| -------------------------- | ---------- | --------------------------- |
---------------------------------------------------- |
+| CheckTimeSeriesExistsAsync | string | check if time series exists |
session_pool.CheckTimeSeriesExistsAsync(time series) |
+
+
+
+用法可以参考[用户示例](https://github.com/apache/iotdb-client-csharp/tree/main/samples/Apache.IoTDB.Samples)
+
+## 连接池
+
+为了实现并发客户端请求,我们提供了针对原生接口的连接池(`SessionPool`),由于`SessionPool`本身为`Session`的超集,当`SessionPool`的`pool_size`参数设置为1时,退化为原来的`Session`
+
+我们使用`ConcurrentQueue`数据结构封装了一个客户端队列,以维护与服务端的多个连接,当调用`Open()`接口时,会在该队列中创建指定个数的客户端,同时通过`System.Threading.Monitor`类实现对队列的同步访问。
+
+当请求发生时,会尝试从连接池中寻找一个空闲的客户端连接,如果没有空闲连接,那么程序将需要等待直到有空闲连接
+
+当一个连接被用完后,他会自动返回池中等待下次被使用
+
+## ByteBuffer
+
+在传入RPC接口参数时,需要对Record和Tablet两种数据结构进行序列化,我们主要通过封装的ByteBuffer类实现
+
+在封装字节序列的基础上,我们进行了内存预申请与内存倍增的优化,减少了序列化过程中内存的申请和释放,在一个拥有20000行的Tablet上进行序列化测试时,速度比起原生的数组动态增长具有**35倍的性能加速**
+
+### 实现介绍
+在进行`RowRecords`以及`Tablet`的插入时,我们需要对多行RowRecord和Tablet进行序列化以进行发送。客户端中的序列化实现主要依赖于ByteBuffer完成。接下来我们介绍ByteBuffer的实现细节。本文包含如下几点内容:
+ - 序列化的协议
+ - C#与Java的大小端的差异
+ - ByteBuffer内存倍增算法
+
+### 序列化协议
+客户端向IoTDB服务器发送的序列化数据总体应该包含两个信息。
+ - 数据类型
+ - 数据本身
+
+其中对于`字符串`的序列化时,我们需要再加入字符串的长度信息。即一个字符串的序列化完整结果为:
+
+ [类型][长度][数据内容]
+接下来我们分别介绍`RowRecord`、`Tablet`的序列化方式
+
+#### RowRecord
+我们对RowRecord进行序列化时,`伪代码`如下:
+```csharp
+public byte[] value_to_bytes(List<TSDataType> data_types, List<string> values){
+ ByteBuffer buffer = new ByteBuffer(values.Count);
+ for(int i = 0;i < data_types.Count(); i++){
+ buffer.add_type((data_types[i]);
+ buffer.add_val(values[i]);
+ }
+}
+```
+
+对于其序列化的结果格式如下:
+
+ [数据类型1][数据1][数据类型2][数据2]...[数据类型N][数据N]
+ 其中数据类型为自定义的`Enum`变量,分别如下:
+```csharp
+public enum TSDataType{BOOLEAN, INT32, INT64, FLOAT, DOUBLE, TEXT, NONE};
+```
+
+#### Tablet序列化
+使用`Tabelt`进行数据插入时有如下限制:
+
+ 限制:Tablet中数据不能有空值
+由于向 `IoTDB`服务器发送`Tablet`数据插入请求时会携带`行数`, `列数`,
`列数据类型`,所以`Tabelt`序列化时我们不需要加入数据类型信息。`Tablet`是`按照列进行序列化`,这是因为后端可以通过行数得知出当前列的元素个数,同时根据列类型来对数据进行解析。
+
+### CSharp与Java序列化数据时的大小端差异
+由于Java序列化默认大端协议,而CSharp序列化默认得到小端序列。所以我们在CSharp中序列化数据之后,需要对数据进行反转这样后端才可以正常解析。同时当我们从后端获取到序列化的结果时(如`SessionDataset`),我们也需要对获得的数据进行反转以解析内容。这其中特例便是字符串的序列化,CSharp中对字符串的序列化结果为大端序,所以序列化字符串或者接收到字符串序列化结果时,不需要反转序列结果。
+
+### ByteBuffer内存倍增法
+拥有数万行的Tablet的序列化结果可能有上百兆,为了能够高效的实现大`Tablet`的序列化,我们对ByteBuffer使用`内存倍增法`的策略来减少序列化过程中对于内存的申请和释放。即当当前的buffer的长度不足以放下序列化结果时,我们将当前buffer的内存`至少`扩增2倍。这极大的减少了内存的申请释放次数,加速了大Tablet的序列化速度。
+```csharp
+private void extend_buffer(int space_need){
+ if(write_pos + space_need >= total_length){
+ total_length = max(space_need, total_length);
+ byte[] new_buffer = new byte[total_length * 2];
+ buffer.CopyTo(new_buffer, 0);
+ buffer = new_buffer;
+ total_length = 2 * total_length;
+ }
+}
+```
+同时在序列化`Tablet`时,我们首先根据Tablet的`行数`,`列数`以及每一列的数据类型估计当前`Tablet`序列化结果所需要的内存大小,并在初始化时进行内存的申请。这进一步的减少了内存的申请释放频率。
+
+通过上述的策略,我们在一个有`20000`行的Tablet上进行测试时,序列化速度相比Naive数组长度动态生长实现算法具有约35倍的性能加速。
+
+## 异常重连
+
+当服务端发生异常或者宕机重启时,客户端中原来通过`Open()`产生的的session会失效,抛出`TException`异常
+
+为了避免这一情况的发生,我们对大部分的接口进行了增强,一旦出现连接问题,就会尝试重新调用`Open()`接口并创建新的Session,并尝试重新发送对应的请求
+
diff --git a/src/zh/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
b/src/zh/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
new file mode 100644
index 0000000..3bd4e13
--- /dev/null
+++ b/src/zh/UserGuide/V1.2.x/API/Programming-NodeJS-Native-API.md
@@ -0,0 +1,201 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Node.js 原生接口
+
+IoTDB 使用 Thrift 作为跨语言的 RPC 框架,因此可以通过 Thrift 提供的接口来实现对 IoTDB 的访问。本文档将介绍如何生成可访问
IoTDB 的原生 Node.js 接口。
+
+
+## 依赖
+
+ * JDK >= 1.8
+ * Node.js >= 16.0.0
+ * thrift 0.14.1
+ * Linux、Macos 或其他类 unix 系统
+ * Windows+bash (下载 IoTDB Go client 需要 git ,通过 WSL、cygwin、Git Bash 任意一种方式均可)
+
+必须安装 thrift(0.14.1 或更高版本)才能将 thrift 文件编译为 Node.js 代码。下面是官方的安装教程,最终,您应该得到一个
thrift 可执行文件。
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## 编译 thrift 库,生成 Node.js 原生接口
+
+1. 在 IoTDB 源代码文件夹的根目录中找到 pom.xml 文件。
+2. 打开 pom.xml 文件,找到以下内容:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. 参考该设置,在 pom.xml 文件中添加以下内容,用来生成 Node.js 的原生接口:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-nodejs</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>js:node</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-nodejs</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. 在 IoTDB 源代码文件夹的根目录下,运行`mvn clean generate-sources`,
+
+这个指令将自动删除`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`中的文件,并使用新生成的 thrift 文件重新填充该文件夹。
+
+这个文件夹在 git 中会被忽略,并且**永远不应该被推到 git 中!**
+
+**注意**不要将`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`上传到 git 仓库中 !
+
+## 使用 Node.js 原生接口
+
+将 `iotdb/iotdb-protocol/thrift/target/generated-sources-nodejs/` 和
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-nodejs/`
中的文件复制到您的项目中,即可使用。
+
+
+## 支持的 rpc 接口
+
+```
+// 打开一个 session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// 关闭一个 session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// 执行一条 SQL 语句
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// 批量执行 SQL 语句
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// 执行查询 SQL 语句
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// 执行插入、删除 SQL 语句
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// 向服务器取下一批查询结果
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// 获取元数据
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// 取消某次查询操作
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// 关闭查询操作数据集,释放资源
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// 获取时区信息
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// 设置时区
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// 获取服务端配置
+ServerProperties getProperties();
+
+// 设置 database
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// 创建时间序列
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// 创建多条时间序列
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// 删除时间序列
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// 删除 database
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// 按行插入数据
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// 按 String 格式插入一条数据
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// 按列插入数据
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// 按列批量插入数据
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// 按行批量插入数据
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// 按行批量插入同属于某个设备的数据
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 按 String 格式批量按行插入数据
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 测试按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// 测试批量按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// 测试按 String 格式按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// 测试按行批量插入同属于某个设备的数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 测试按 String 格式批量按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 删除数据
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// 执行原始数据查询
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// 向服务器申请一个查询语句 ID
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git a/src/zh/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
b/src/zh/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
new file mode 100644
index 0000000..d757105
--- /dev/null
+++ b/src/zh/UserGuide/V1.2.x/API/Programming-Rust-Native-API.md
@@ -0,0 +1,200 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+
+# Rust 原生接口
+
+IoTDB 使用 Thrift 作为跨语言的 RPC 框架,因此可以通过 Thrift 提供的接口来实现对 IoTDB 的访问。本文档将介绍如何生成可访问
IoTDB 的原生 Rust 接口。
+
+
+## 依赖
+
+ * JDK >= 1.8
+ * Rust >= 1.0.0
+ * thrift 0.14.1
+ * Linux、Macos 或其他类 unix 系统
+ * Windows+bash (下载 IoTDB Go client 需要 git ,通过 WSL、cygwin、Git Bash 任意一种方式均可)
+
+必须安装 thrift(0.14.1 或更高版本)才能将 thrift 文件编译为 Rust 代码。下面是官方的安装教程,最终,您应该得到一个 thrift
可执行文件。
+
+```
+http://thrift.apache.org/docs/install/
+```
+
+
+## 编译 thrift 库,生成 Rust 原生接口
+
+1. 在 IoTDB 源代码文件夹的根目录中找到 pom.xml 文件。
+2. 打开 pom.xml 文件,找到以下内容:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-java</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>java</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ </configuration>
+</execution>
+```
+3. 参考该设置,在 pom.xml 文件中添加以下内容,用来生成 Rust 的原生接口:
+
+```xml
+<execution>
+ <id>generate-thrift-sources-rust</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <generator>rs</generator>
+ <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+ <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+ <includes>**/common.thrift,**/client.thrift</includes>
+
<outputDirectory>${project.build.directory}/generated-sources-rust</outputDirectory>
+ </configuration>
+</execution>
+```
+
+4. 在 IoTDB 源代码文件夹的根目录下,运行`mvn clean generate-sources`,
+
+这个指令将自动删除`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`中的文件,并使用新生成的 thrift 文件重新填充该文件夹。
+
+这个文件夹在 git 中会被忽略,并且**永远不应该被推到 git 中!**
+
+**注意**不要将`iotdb/iotdb-protocol/thrift/target` 和
`iotdb/iotdb-protocol/thrift-commons/target`上传到 git 仓库中 !
+
+## 使用 Rust 原生接口
+
+将 `iotdb/iotdb-protocol/thrift/target/generated-sources-rust/` 和
`iotdb/iotdb-protocol/thrift-commons/target/generated-sources-rust/`
中的文件复制到您的项目中,即可使用。
+
+## 支持的 rpc 接口
+
+```
+// 打开一个 session
+TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+// 关闭一个 session
+TSStatus closeSession(1:TSCloseSessionReq req);
+
+// 执行一条 SQL 语句
+TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+// 批量执行 SQL 语句
+TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+// 执行查询 SQL 语句
+TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+// 执行插入、删除 SQL 语句
+TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+// 向服务器取下一批查询结果
+TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+// 获取元数据
+TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+// 取消某次查询操作
+TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+// 关闭查询操作数据集,释放资源
+TSStatus closeOperation(1:TSCloseOperationReq req);
+
+// 获取时区信息
+TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+// 设置时区
+TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+// 获取服务端配置
+ServerProperties getProperties();
+
+// 设置 database
+TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+// 创建时间序列
+TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+// 创建多条时间序列
+TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+// 删除时间序列
+TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+// 删除 database
+TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+// 按行插入数据
+TSStatus insertRecord(1:TSInsertRecordReq req);
+
+// 按 String 格式插入一条数据
+TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
+
+// 按列插入数据
+TSStatus insertTablet(1:TSInsertTabletReq req);
+
+// 按列批量插入数据
+TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+// 按行批量插入数据
+TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+// 按行批量插入同属于某个设备的数据
+TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 按 String 格式批量按行插入数据
+TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 测试按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+// 测试批量按列插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+// 测试按 String 格式按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
+
+// 测试按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+// 测试按行批量插入同属于某个设备的数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
+
+// 测试按 String 格式批量按行插入数据的延迟,注意:该接口不真实插入数据,只用来测试网络延迟
+TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
+
+// 删除数据
+TSStatus deleteData(1:TSDeleteDataReq req);
+
+// 执行原始数据查询
+TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
+
+// 向服务器申请一个查询语句 ID
+i64 requestStatementId(1:i64 sessionId);
+```
diff --git
a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md
b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md
index 19880f7..f94180f 100644
---
a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md
+++
b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Deployment-Guide_timecho.md
@@ -76,7 +76,7 @@ Windows 系统启动命令如下:
### 集群管理工具部署
-IoTDB集群管理工具是一款超级易用的 Apache IoTDB 集群部署工具。本文档将说明如何用集群管理工具如何远程部署、配置、启动和停止 Apache
IoTDB 集群实例。关于集群管理工具的更多信息请点击:
[集群管理工具](../Tools-System/Maintenance-Tool.md##集群管理工具)
+IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB
分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止
IoTDB 集群实例。
#### 部署集群管理工具
@@ -88,9 +88,9 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat
##### 部署方法
-###### 方案一 二进制包下载安装
+###### 下载安装
-目前二进制文件仅支持linux 和mac
操作系统,二进制文件下载地址:https://github.com/TimechoLab/iotdb-deploy/releases
+本工具为IoTDB企业版配套工具,您可以联系您的销售获取工具下载方式。
注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本
@@ -112,30 +112,6 @@ iotd cluster check example
<iotd absolute path>/sbin/iotd cluster check example
```
-###### 方案二 源码包下载安装
-
-源码包执行需要依赖python3.8及以上版本
-
-* 执行如下命令下载源码包
-
-```bash
-git clone https://github.com/TimechoLab/iotdb-deploy.git
-```
-
-* 在iotd-deploy目录内输入以下指令后:
-
-```bash
-bash install.sh
-```
-
-即可在之后的 shell 内激活 iotd 关键词,并安装所需的 whl 包。注意下载的iotd-deploy不要放在包含空格的目录下面,防止无法使用。
-
-* 如果要在该 shell 内立刻激活该关键词,需要执行:
-
-```bash
-alias "iotd=python3 <main.py's absolute path>"
-```
-
#### 集群配置文件介绍
* 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml
文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。
diff --git a/src/zh/UserGuide/V1.2.x/Tools-System/Maintenance-Tool_timecho.md
b/src/zh/UserGuide/V1.2.x/Tools-System/Maintenance-Tool_timecho.md
index 3c138fa..bfe1d84 100644
--- a/src/zh/UserGuide/V1.2.x/Tools-System/Maintenance-Tool_timecho.md
+++ b/src/zh/UserGuide/V1.2.x/Tools-System/Maintenance-Tool_timecho.md
@@ -25,7 +25,7 @@
### 集群管理工具部署
-IoTDB集群管理工具是一款超级易用的 Apache IoTDB 集群部署工具。本文档将说明如何用集群管理工具如何远程部署、配置、启动和停止 Apache
IoTDB 集群实例。关于集群管理工具的更多信息请点击:
[集群管理工具](../Tools-System/Maintenance-Tool.md##集群管理工具)
+IoTDB 集群管理工具是一款易用的运维工具(企业版工具)。旨在解决 IoTDB
分布式系统多节点的运维难题,主要包括集群部署、集群启停、弹性扩容、配置更新、数据导出等功能,从而实现对复杂数据库集群的一键式指令下发,极大降低管理难度。本文档将说明如何用集群管理工具远程部署、配置、启动和停止
IoTDB 集群实例。
#### 部署集群管理工具
@@ -37,9 +37,9 @@ IoTDB 要部署的机器需要依赖jdk 8及以上版本、lsof 或者 netstat
##### 部署方法
-###### 方案一 二进制包下载安装
+###### 下载安装
-目前二进制文件仅支持linux 和mac
操作系统,二进制文件下载地址:https://github.com/TimechoLab/iotdb-deploy/releases
+本工具为IoTDB企业版配套工具,您可以联系您的销售获取工具下载方式。
注意:由于二进制包仅支持GLIBC2.17 及以上版本,因此最低适配Centos7版本
@@ -61,30 +61,6 @@ iotd cluster check example
<iotd absolute path>/sbin/iotd cluster check example
```
-###### 方案二 源码包下载安装
-
-源码包执行需要依赖python3.8及以上版本
-
-* 执行如下命令下载源码包
-
-```bash
-git clone https://github.com/TimechoLab/iotdb-deploy.git
-```
-
-* 在iotd-deploy目录内输入以下指令后:
-
-```bash
-bash install.sh
-```
-
-即可在之后的 shell 内激活 iotd 关键词,并安装所需的 whl 包。注意下载的iotd-deploy不要放在包含空格的目录下面,防止无法使用。
-
-* 如果要在该 shell 内立刻激活该关键词,需要执行:
-
-```bash
-alias "iotd=python3 <main.py's absolute path>"
-```
-
#### 集群配置文件介绍
* 在`iotd/config` 目录下有集群配置的yaml文件,yaml文件名字就是集群名字yaml
文件可以有多个,为了方便用户配置yaml文件在iotd/config目录下面提供了`default_cluster.yaml`示例。