From b47b82d651115c5b41bd33df126d4e4265cd22fc Mon Sep 17 00:00:00 2001
From: W1y1r <2730956796@qq.com>
Date: Tue, 21 Jan 2025 11:35:33 +0800
Subject: [PATCH 1/2] rebuild java api and data subscription docs
---
src/.vuepress/sidebar/V1.3.3/en.ts | 7 +-
src/.vuepress/sidebar/V1.3.3/zh.ts | 7 +-
src/.vuepress/sidebar_timecho/V1.3.3/en.ts | 7 +-
src/.vuepress/sidebar_timecho/V1.3.3/zh.ts | 7 +-
.../sidebar_timecho/V2.0.1/zh-Tree.ts | 7 +-
.../Tree/API/Programming-Data-Subscription.md | 257 ++++
.../Tree/API/Programming-Java-Native-API.md | 1208 ++++++-----------
.../Tree/API/Programming-Data-Subscription.md | 257 ++++
.../Tree/API/Programming-Java-Native-API.md | 1205 ++++++----------
.../API/Programming-Data-Subscription.md | 257 ++++
.../latest/API/Programming-Java-Native-API.md | 1174 ++++++----------
.../Tree/API/Programming-Data-Subscription.md | 266 ++++
.../Tree/API/Programming-Java-Native-API.md | 1168 ++++++----------
.../Tree/API/Programming-Data-Subscription.md | 266 ++++
.../Tree/API/Programming-Java-Native-API.md | 1165 ++++++----------
.../API/Programming-Data-Subscription.md | 266 ++++
.../latest/API/Programming-Java-Native-API.md | 1166 ++++++----------
17 files changed, 4130 insertions(+), 4560 deletions(-)
create mode 100644 src/UserGuide/Master/Tree/API/Programming-Data-Subscription.md
create mode 100644 src/UserGuide/V2.0.1/Tree/API/Programming-Data-Subscription.md
create mode 100644 src/UserGuide/latest/API/Programming-Data-Subscription.md
create mode 100644 src/zh/UserGuide/Master/Tree/API/Programming-Data-Subscription.md
create mode 100644 src/zh/UserGuide/V2.0.1/Tree/API/Programming-Data-Subscription.md
create mode 100644 src/zh/UserGuide/latest/API/Programming-Data-Subscription.md
diff --git a/src/.vuepress/sidebar/V1.3.3/en.ts b/src/.vuepress/sidebar/V1.3.3/en.ts
index 874d18640..b63b54712 100644
--- a/src/.vuepress/sidebar/V1.3.3/en.ts
+++ b/src/.vuepress/sidebar/V1.3.3/en.ts
@@ -147,7 +147,12 @@ export const enSidebar = {
prefix: 'API/',
// children: 'structure',
children: [
- { text: 'Java Native API', link: 'Programming-Java-Native-API' },
+ { text: 'Java Native Interface', collapsible: true,
+ children: [
+ { text: 'Java Native API', link: 'Programming-Java-Native-API' },
+ { text: 'Data Subscription API', link: 'Programming-Data-Subscription' },
+ ],
+ },
{ 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' },
diff --git a/src/.vuepress/sidebar/V1.3.3/zh.ts b/src/.vuepress/sidebar/V1.3.3/zh.ts
index 97ee05677..16d5e6166 100644
--- a/src/.vuepress/sidebar/V1.3.3/zh.ts
+++ b/src/.vuepress/sidebar/V1.3.3/zh.ts
@@ -134,7 +134,12 @@ export const zhSidebar = {
prefix: 'API/',
// children: 'structure',
children: [
- { text: 'Java原生接口', link: 'Programming-Java-Native-API' },
+ { text: 'Java原生接口', collapsible: true,
+ children: [
+ { text: 'Java原生API', link: 'Programming-Java-Native-API' },
+ { text: '数据订阅API', link: 'Programming-Data-Subscription' },
+ ],
+ },
{ text: 'Python原生接口', link: 'Programming-Python-Native-API' },
{ text: 'C++原生接口', link: 'Programming-Cpp-Native-API' },
{ text: 'Go原生接口', link: 'Programming-Go-Native-API' },
diff --git a/src/.vuepress/sidebar_timecho/V1.3.3/en.ts b/src/.vuepress/sidebar_timecho/V1.3.3/en.ts
index a539be0dd..29748b983 100644
--- a/src/.vuepress/sidebar_timecho/V1.3.3/en.ts
+++ b/src/.vuepress/sidebar_timecho/V1.3.3/en.ts
@@ -163,7 +163,12 @@ export const enSidebar = {
prefix: 'API/',
// children: 'structure',
children: [
- { text: 'Java Native API', link: 'Programming-Java-Native-API' },
+ { text: 'Java Native Interface', collapsible: true,
+ children: [
+ { text: 'Java Native API', link: 'Programming-Java-Native-API' },
+ { text: 'Data Subscription API', link: 'Programming-Data-Subscription' },
+ ],
+ },
{ 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' },
diff --git a/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts b/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts
index acd81e02f..54dcb21e4 100644
--- a/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts
+++ b/src/.vuepress/sidebar_timecho/V1.3.3/zh.ts
@@ -146,7 +146,12 @@ export const zhSidebar = {
prefix: 'API/',
// children: 'structure',
children: [
- { text: 'Java原生接口', link: 'Programming-Java-Native-API' },
+ { text: 'Java原生接口', collapsible: true,
+ children: [
+ { text: 'Java原生API', link: 'Programming-Java-Native-API' },
+ { text: '数据订阅API', link: 'Programming-Data-Subscription' },
+ ],
+ },
{ text: 'Python原生接口', link: 'Programming-Python-Native-API' },
{ text: 'C++原生接口', link: 'Programming-Cpp-Native-API' },
{ text: 'Go原生接口', link: 'Programming-Go-Native-API' },
diff --git a/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts b/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts
index 79e849f58..dc0900727 100644
--- a/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts
+++ b/src/.vuepress/sidebar_timecho/V2.0.1/zh-Tree.ts
@@ -146,7 +146,12 @@ export const zhSidebar = {
prefix: 'API/',
// children: 'structure',
children: [
- { text: 'Java原生接口', link: 'Programming-Java-Native-API' },
+ { text: 'Java原生接口', collapsible: true,
+ children: [
+ { text: 'Java原生API', link: 'Programming-Java-Native-API' },
+ { text: '数据订阅API', link: 'Programming-Data-Subscription' },
+ ],
+ },
{ text: 'Python原生接口', link: 'Programming-Python-Native-API' },
{ text: 'C++原生接口', link: 'Programming-Cpp-Native-API' },
{ text: 'Go原生接口', link: 'Programming-Go-Native-API' },
diff --git a/src/UserGuide/Master/Tree/API/Programming-Data-Subscription.md b/src/UserGuide/Master/Tree/API/Programming-Data-Subscription.md
new file mode 100644
index 000000000..795caba62
--- /dev/null
+++ b/src/UserGuide/Master/Tree/API/Programming-Data-Subscription.md
@@ -0,0 +1,257 @@
+
+
+
+
+# Data subscription API
+
+IoTDB provides a powerful data subscription feature, allowing users to obtain newly added data from IoTDB in real-time through the subscription SDK. For detailed functional definitions and introductions:[Data subscription](../User-Manual/Data-subscription.md)
+
+## 1 Core Steps
+
+1. Create Topic: Create a Topic that includes the measurement points you wish to subscribe to.
+2. Subscribe to Topic: Before a consumer subscribes to a topic, the topic must have been created, otherwise the subscription will fail. Consumers under the same consumer group will evenly distribute the data.
+3. Consume Data: Only by explicitly subscribing to a specific topic will you receive data from that topic.
+4. Unsubscribe: When a consumer is closed, it will exit the corresponding consumer group and cancel all existing subscriptions.
+
+
+## 2 Detailed Steps
+
+This section is used to illustrate the core development process and does not demonstrate all parameters and interfaces. For a comprehensive understanding of all features and parameters, please refer to: [Java Native API](../API/Programming-Java-Native-API.md#3-native-interface-description)
+
+
+### 2.1 Create a Maven project
+
+Create a Maven project and import the following dependencies(JDK >= 1.8, Maven >= 3.6)
+
+```xml
+
+
+ org.apache.iotdb
+ iotdb-session
+
+ ${project.version}
+
+
+```
+
+### 2.2 Code Example
+
+#### 2.2.1 Topic operations
+
+```java
+import java.util.Optional;
+import java.util.Properties;
+import java.util.Set;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.rpc.subscription.config.TopicConstant;
+import org.apache.iotdb.session.subscription.SubscriptionSession;
+import org.apache.iotdb.session.subscription.model.Topic;
+
+public class DataConsumerExample {
+
+ public static void main(String[] args) throws IoTDBConnectionException, StatementExecutionException {
+ try (SubscriptionSession session = new SubscriptionSession("127.0.0.1", 6667)) {
+ // 1. open session
+ session.open();
+
+ // 2. create a topic of all data
+ Properties sessionConfig = new Properties();
+ sessionConfig.put(TopicConstant.PATH_KEY, "root.**");
+
+ session.createTopic("allData", sessionConfig);
+
+ // 3. show all topics
+ Set topics = session.getTopics();
+ System.out.println(topics);
+
+ // 4. show a specific topic
+ Optional allData = session.getTopic("allData");
+ System.out.println(allData.get());
+ }
+ }
+}
+```
+
+#### 2.2.2 Data Consume
+
+##### Scenario-1: Subscribing to newly added real-time data in IoTDB (for scenarios such as dashboard or configuration display)
+
+```java
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import org.apache.iotdb.rpc.subscription.config.ConsumerConstant;
+import org.apache.iotdb.rpc.subscription.config.TopicConstant;
+import org.apache.iotdb.session.subscription.consumer.SubscriptionPullConsumer;
+import org.apache.iotdb.session.subscription.payload.SubscriptionMessage;
+import org.apache.iotdb.session.subscription.payload.SubscriptionMessageType;
+import org.apache.iotdb.session.subscription.payload.SubscriptionSessionDataSet;
+import org.apache.tsfile.read.common.RowRecord;
+
+public class DataConsumerExample {
+
+ public static void main(String[] args) throws IOException {
+
+ // 5. create a pull consumer, the subscription is automatically cancelled when the logic in the try resources is completed
+ Properties consumerConfig = new Properties();
+ consumerConfig.put(ConsumerConstant.CONSUMER_ID_KEY, "c1");
+ consumerConfig.put(ConsumerConstant.CONSUMER_GROUP_ID_KEY, "cg1");
+ consumerConfig.put(ConsumerConstant.CONSUME_LISTENER_KEY, TopicConstant.FORMAT_SESSION_DATA_SETS_HANDLER_VALUE);
+ try (SubscriptionPullConsumer pullConsumer = new SubscriptionPullConsumer(consumerConfig)) {
+ pullConsumer.open();
+ pullConsumer.subscribe("topic_all");
+ while (true) {
+ List messages = pullConsumer.poll(10000);
+ for (final SubscriptionMessage message : messages) {
+ final short messageType = message.getMessageType();
+ if (SubscriptionMessageType.isValidatedMessageType(messageType)) {
+ for (final SubscriptionSessionDataSet dataSet : message.getSessionDataSetsHandler()) {
+ while (dataSet.hasNext()) {
+ final RowRecord record = dataSet.next();
+ System.out.println(record);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+```
+
+##### Scenario-2: Subscribing to newly added TsFiles (for scenarios such as regular data backup)
+
+Prerequisite: The format of the topic to be consumed must be of the TsfileHandler type. For example:`create topic topic_all_tsfile with ('path'='root.**','format'='TsFileHandler')`
+
+```java
+import java.io.IOException;
+import java.util.List;
+import java.util.Properties;
+import org.apache.iotdb.rpc.subscription.config.ConsumerConstant;
+import org.apache.iotdb.rpc.subscription.config.TopicConstant;
+import org.apache.iotdb.session.subscription.consumer.SubscriptionPullConsumer;
+import org.apache.iotdb.session.subscription.payload.SubscriptionMessage;
+
+
+public class DataConsumerExample {
+
+ public static void main(String[] args) throws IOException {
+ // 1. create a pull consumer, the subscription is automatically cancelled when the logic in the try resources is completed
+ Properties consumerConfig = new Properties();
+ consumerConfig.put(ConsumerConstant.CONSUMER_ID_KEY, "c1");
+ consumerConfig.put(ConsumerConstant.CONSUMER_GROUP_ID_KEY, "cg1");
+ // 2. Specify the consumption type as the tsfile type
+ consumerConfig.put(TopicConstant.FORMAT_KEY, TopicConstant.FORMAT_TS_FILE_HANDLER_VALUE);
+ consumerConfig.put(ConsumerConstant.FILE_SAVE_DIR_KEY, "/Users/iotdb/Downloads");
+ try (SubscriptionPullConsumer pullConsumer = new SubscriptionPullConsumer(consumerConfig)) {
+ pullConsumer.open();
+ pullConsumer.subscribe("topic_all_tsfile");
+ while (true) {
+ List messages = pullConsumer.poll(10000);
+ for (final SubscriptionMessage message : messages) {
+ message.getTsFileHandler().copyFile("/Users/iotdb/Downloads/1.tsfile");
+ }
+ }
+ }
+ }
+}
+```
+
+
+
+
+## 3 Java Native API Description
+
+### 3.1 Parameter List
+
+The consumer-related parameters can be set through the Properties parameter object. The specific parameters are as follows:
+
+#### SubscriptionConsumer
+
+
+| **Parameter** | **required or optional with default** | **Parameter Meaning** |
+| :---------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- |
+| host | optional: 127.0.0.1 | `String`: The RPC host of a DataNode in IoTDB |
+| port | optional: 6667 | `Integer`: The RPC port of a DataNode in IoTDB |
+| node-urls | optional: 127.0.0.1:6667 | `List`: The RPC addresses of all DataNodes in IoTDB, which can be multiple; either host:port or node-urls can be filled. If both host:port and node-urls are filled, the **union** of host:port and node-urls will be taken to form a new node-urls for application |
+| username | optional: root | `String`: The username of the DataNode in IoTDB |
+| password | optional: root | `String`: The password of the DataNode in IoTDB |
+| groupId | optional | `String`: consumer group id,if not specified, it will be randomly assigned (a new consumer group),ensuring that the consumer group id of different consumer groups are all different |
+| consumerId | optional | `String`: consumer client id,if not specified, it will be randomly assigned,ensuring that each consumer client id in the same consumer group is different |
+| heartbeatIntervalMs | optional: 30000 (min: 1000) | `Long`: The interval at which the consumer sends periodic heartbeat requests to the IoTDB DataNode |
+| endpointsSyncIntervalMs | optional: 120000 (min: 5000) | `Long`: The interval at which the consumer detects the expansion or contraction of IoTDB cluster nodes and adjusts the subscription connection |
+| fileSaveDir | optional: Paths.get(System.getProperty("user.dir"), "iotdb-subscription").toString() | `String`: The temporary directory path where the consumer stores the subscribed TsFile files |
+| fileSaveFsync | optional: false | `Boolean`: Whether the consumer actively calls fsync during the subscription of TsFiles |
+
+Special configurations in `SubscriptionPushConsumer` :
+
+| **Parameter** | **required or optional with default** | **Parameter Meaning** |
+| :----------------- | :------------------------------------ | :----------------------------------------------------------- |
+| ackStrategy | optional: `ACKStrategy.AFTER_CONSUME` | The acknowledgment mechanism for consumption progress includes the following options: `ACKStrategy.BEFORE_CONSUME`(the consumer submits the consumption progress immediately upon receiving the data, before `onReceive` )`ACKStrategy.AFTER_CONSUME`(the consumer submits the consumption progress after consuming the data, after `onReceive` ) |
+| consumeListener | optional | The callback function for consuming data, which needs to implement the `ConsumeListener` interface, defining the processing logic for consuming `SessionDataSetsHandler` and `TsFileHandler` formatted data |
+| autoPollIntervalMs | optional: 5000 (min: 500) | Long: The time interval at which the consumer automatically pulls data, in **ms** |
+| autoPollTimeoutMs | optional: 10000 (min: 1000) | Long: The timeout duration for the consumer to pull data each time, in **ms** |
+
+Special configurations in `SubscriptionPullConsumer` :
+
+| **Parameter** | **required or optional with default** | **Parameter Meaning** |
+| :----------------- | :------------------------------------ | :----------------------------------------------------------- |
+| autoCommit | optional: true | Boolean: Whether to automatically commit the consumption progress. If this parameter is set to false, the `commit` method needs to be called manually to submit the consumption progress |
+| autoCommitInterval | optional: 5000 (min: 500) | Long: The time interval for automatically committing the consumption progress, in **ms** .This parameter only takes effect when the `autoCommit` parameter is set to true |
+
+
+### 3.2 Function List
+
+#### Data subscription
+
+##### SubscriptionPullConsumer
+
+| **Function name** | **Description** | **Parameter** |
+| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| `open()` | Opens the consumer connection and starts message consumption. If `autoCommit` is enabled, it will start the automatic commit worker. | None |
+| `close()` | Closes the consumer connection. If `autoCommit` is enabled, it will commit all uncommitted messages before closing. | None |
+| `poll(final Duration timeout)` | Pulls messages with a specified timeout. | `timeout` : The timeout duration. |
+| `poll(final long timeoutMs)` | Pulls messages with a specified timeout in milliseconds. | `timeoutMs` : The timeout duration in milliseconds. |
+| `poll(final Set topicNames, final Duration timeout)` | Pulls messages from specified topics with a specified timeout. | `topicNames` : The set of topics to pull messages from. `timeout`: The timeout duration。 |
+| `poll(final Set topicNames, final long timeoutMs)` | Pulls messages from specified topics with a specified timeout in milliseconds. | `topicNames` : The set of topics to pull messages from.`timeoutMs`: The timeout duration in milliseconds. |
+| `commitSync(final SubscriptionMessage message)` | Synchronously commits a single message. | `message` : The message object to be committed. |
+| `commitSync(final Iterable messages)` | Synchronously commits multiple messages. | `messages` : The collection of message objects to be committed. |
+| `commitAsync(final SubscriptionMessage message)` | Asynchronously commits a single message. | `message` : The message object to be committed. |
+| `commitAsync(final Iterable messages)` | Asynchronously commits multiple messages. | `messages` : The collection of message objects to be committed. |
+| `commitAsync(final SubscriptionMessage message, final AsyncCommitCallback callback)` | Asynchronously commits a single message with a specified callback. | `message` : The message object to be committed. `callback` : The callback function to be executed after asynchronous commit. |
+| `commitAsync(final Iterable messages, final AsyncCommitCallback callback)` | Asynchronously commits multiple messages with a specified callback. | `messages` : The collection of message objects to be committed.`callback` : The callback function to be executed after asynchronous commit. |
+
+##### SubscriptionPushConsumer
+
+| **Function name** | **Description** | **Parameter** |
+| -------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| `open()` | Opens the consumer connection, starts message consumption, and submits the automatic polling worker. | None |
+| `close()` | Closes the consumer connection and stops message consumption. | None |
+| `toString()` | Returns the core configuration information of the consumer object. | None |
+| `coreReportMessage()` | Obtains the key-value representation of the consumer's core configuration. | None |
+| `allReportMessage()` | Obtains the key-value representation of all the consumer's configurations. | None |
+| `buildPushConsumer()` | Builds a `SubscriptionPushConsumer` instance through the `Builder` | None |
+| `ackStrategy(final AckStrategy ackStrategy)` | Configures the message acknowledgment strategy for the consumer. | `ackStrategy`: The specified message acknowledgment strategy. |
+| `consumeListener(final ConsumeListener consumeListener)` | Configures the message consumption logic for the consumer. | `consumeListener`: The processing logic when the consumer receives messages. |
+| `autoPollIntervalMs(final long autoPollIntervalMs)` | Configures the interval for automatic polling. | `autoPollIntervalMs` : The interval for automatic polling, in milliseconds. |
+| `autoPollTimeoutMs(final long autoPollTimeoutMs)` | Configures the timeout for automatic polling.间。 | `autoPollTimeoutMs`: The timeout for automatic polling, in milliseconds. |
\ No newline at end of file
diff --git a/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md b/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md
index 984b06ab4..2b2b68da3 100644
--- a/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md
+++ b/src/UserGuide/Master/Tree/API/Programming-Java-Native-API.md
@@ -1,845 +1,479 @@
+
+# Session Native API
+
+In the native API of IoTDB, the `Session` is the core interface for interacting with the database. It integrates a rich set of methods that support data writing, querying, and metadata operations. By instantiating a `Session`, you can establish a connection to the IoTDB server and perform various database operations within the environment constructed by this connection. The `Session` is not thread-safe and should not be called simultaneously by multiple threads.
--->
+`SessionPool` is a connection pool for `Session`, and it is recommended to use `SessionPool` for programming. In scenarios with multi-threaded concurrency, `SessionPool` can manage and allocate connection resources effectively, thereby improving system performance and resource utilization efficiency.
-# Java Native API
+## 1 Overview of Steps
-## Installation
+1. Create a Connection Pool Instance: Initialize a SessionPool object to manage multiple Session instances.
+2. Perform Operations: Directly obtain a Session instance from the SessionPool and execute database operations, without the need to open and close connections each time.
+3. Close Connection Pool Resources: When database operations are no longer needed, close the SessionPool to release all related resources.
-### Dependencies
-* JDK >= 1.8
-* Maven >= 3.6
+## 2 Detailed Steps
+This section provides an overview of the core development process and does not demonstrate all parameters and interfaces. For a complete list of functionalities and parameters, please refer to:[Java Native API](./Programming-Java-Native-API.md#3-native-interface-description) or check the: [Source Code](https://github.com/apache/iotdb/tree/master/example/session/src/main/java/org/apache/iotdb)
-### Using IoTDB Java Native API with Maven
+### 2.1 Create a Maven Project
+
+Create a Maven project and add the following dependencies to the pom.xml file (JDK >= 1.8, Maven >= 3.6):
```xml
org.apache.iotdbiotdb-session
- 1.0.0
+
+ ${project.version}
```
-## Syntax Convention
-
-- **IoTDB-SQL interface:** The input SQL parameter needs to conform to the [syntax conventions](../User-Manual/Syntax-Rule.md#Literal-Values) and be escaped for JAVA strings. For example, you need to add a backslash before the double-quotes. (That is: after JAVA escaping, it is consistent with the SQL statement executed on the command line.)
-- **Other interfaces:**
- - The node names in path or path prefix as parameter: The node names which should be escaped by backticks (`) in the SQL statement, escaping is required here.
- - Identifiers (such as template names) as parameters: The identifiers which should be escaped by backticks (`) in the SQL statement, and escaping is not required here.
-- **Code example for syntax convention could be found at:** `example/session/src/main/java/org/apache/iotdb/SyntaxConventionRelatedExample.java`
-
-## Native APIs
-
-Here we show the commonly used interfaces and their parameters in the Native API:
-
-### Session Management
-
-* Initialize a Session
-
-``` java
-// use default configuration
-session = new Session.Builder.build();
-
-// initialize with a single node
-session =
- new Session.Builder()
- .host(String host)
- .port(int port)
- .build();
-
-// initialize with multiple nodes
-session =
- new Session.Builder()
- .nodeUrls(List nodeUrls)
- .build();
-
-// other configurations
-session =
- new Session.Builder()
- .fetchSize(int fetchSize)
- .username(String username)
- .password(String password)
- .thriftDefaultBufferSize(int thriftDefaultBufferSize)
- .thriftMaxFrameSize(int thriftMaxFrameSize)
- .enableRedirection(boolean enableRedirection)
- .version(Version version)
- .build();
-```
-
-Version represents the SQL semantic version used by the client, which is used to be compatible with the SQL semantics of 0.12 when upgrading 0.13. The possible values are: `V_0_12`, `V_0_13`, `V_1_0`, etc.
-
-
-* Open a Session
-
-``` java
-void open()
-```
-
-* Open a session, with a parameter to specify whether to enable RPC compression
-
-``` java
-void open(boolean enableRPCCompression)
-```
-
-Notice: this RPC compression status of client must comply with that of IoTDB server
-
-* Close a Session
-
-``` java
-void close()
-```
-
-* SessionPool
-
-We provide a connection pool (`SessionPool) for Native API.
-Using the interface, you need to define the pool size.
-
-If you can not get a session connection in 60 seconds, there is a warning log but the program will hang.
-
-If a session has finished an operation, it will be put back to the pool automatically.
-If a session connection is broken, the session will be removed automatically and the pool will try
-to create a new session and redo the operation.
-You can also specify an url list of multiple reachable nodes when creating a SessionPool, just as you would when creating a Session. To ensure high availability of clients in distributed cluster.
-
-For query operations:
-
-1. When using SessionPool to query data, the result set is `SessionDataSetWrapper`;
-2. Given a `SessionDataSetWrapper`, if you have not scanned all the data in it and stop to use it,
-you have to call `SessionPool.closeResultSet(wrapper)` manually;
-3. When you call `hasNext()` and `next()` of a `SessionDataSetWrapper` and there is an exception, then
-you have to call `SessionPool.closeResultSet(wrapper)` manually;
-4. You can call `getColumnNames()` of `SessionDataSetWrapper` to get the column names of query result;
-
-Examples: ```session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java```
-
-Or `example/session/src/main/java/org/apache/iotdb/SessionPoolExample.java`
-
-
-### Database & Timeseries Management API
-
-#### Database Management
-
-* CREATE DATABASE
-
-``` java
-void setStorageGroup(String storageGroupId)
-```
-
-* Delete one or several databases
-
-``` java
-void deleteStorageGroup(String storageGroup)
-void deleteStorageGroups(List storageGroups)
-```
-
-#### Timeseries Management
-
-* Create one or multiple timeseries
-
-``` java
-void createTimeseries(String path, TSDataType dataType,
- TSEncoding encoding, CompressionType compressor, Map props,
- Map tags, Map attributes, String measurementAlias)
-
-void createMultiTimeseries(List paths, List dataTypes,
- List encodings, List compressors,
- List