Skip to content

Commit 3f5b15b

Browse files
committed
add chapter number in table doc-en
1 parent f238ae0 commit 3f5b15b

112 files changed

Lines changed: 1187 additions & 1054 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/UserGuide/Master/Table/API/Programming-JDBC.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
under the License.
1919
2020
-->
21+
# JDBC
2122

2223
The IoTDB JDBC provides a standardized way to interact with the IoTDB database, allowing users to execute SQL statements from Java programs for managing databases and time-series data. It supports operations such as connecting to the database, creating, querying, updating, and deleting data, as well as batch insertion and querying of time-series data.
2324

2425
**Note:** The current JDBC implementation is designed primarily for integration with third-party tools. High-performance writing **may not be achieved** when using JDBC for insert operations. For Java applications, it is recommended to use the **JAVA Native API** for optimal performance.
2526

26-
## Prerequisites
27+
## 1. Prerequisites
2728

28-
### **Environment Requirements**
29+
### 1.1 **Environment Requirements**
2930

3031
- **JDK:** Version 1.8 or higher
3132
- **Maven:** Version 3.6 or higher
3233

33-
### **Adding Maven Dependencies**
34+
### 1.2 **Adding Maven Dependencies**
3435

3536
Add the following dependency to your Maven `pom.xml` file:
3637

@@ -44,13 +45,13 @@ Add the following dependency to your Maven `pom.xml` file:
4445
</dependencies>
4546
```
4647

47-
## Read and Write Operations
48+
## 2. Read and Write Operations
4849

4950
**Write Operations:** Perform database operations such as inserting data, creating databases, and creating time-series using the `execute` method.
5051

5152
**Read Operations:** Execute queries using the `executeQuery` method and retrieve results via the `ResultSet` object.
5253

53-
### Method Overview
54+
### 2.1 Method Overview
5455

5556
| **Method Name** | **Description** | **Parameters** | **Return Value** |
5657
| ------------------------------------------------------------ | ----------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------- |
@@ -63,7 +64,7 @@ Add the following dependency to your Maven `pom.xml` file:
6364
| ResultSet.next() | Moves to the next row in the result set | None | `boolean`: Whether the move was successful |
6465
| ResultSet.getString(int columnIndex) | Retrieves the string value of a specified column | `columnIndex`: Column index (starting from 1) | `String`: Column value |
6566

66-
## Sample Code
67+
## 3. Sample Code
6768

6869
**Note:** When using the Table Model, you must specify the `sql_dialect` parameter as `table` in the URL. Example:
6970

src/UserGuide/Master/Table/API/Programming-Java-Native-API.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@
1818
under the License.
1919
2020
-->
21+
# Java Native API
2122

2223
IoTDB provides a Java native client driver and a session pool management mechanism. These tools enable developers to interact with IoTDB using object-oriented APIs, allowing time-series objects to be directly assembled and inserted into the database without constructing SQL statements. It is recommended to use the `ITableSessionPool` for multi-threaded database operations to maximize efficiency.
2324

24-
## Prerequisites
25+
## 1. Prerequisites
2526

26-
### Environment Requirements
27+
### 1.1 Environment Requirements
2728

2829
- **JDK**: Version 1.8 or higher
2930
- **Maven**: Version 3.6 or higher
3031

31-
### Adding Maven Dependencies
32+
### 1.2 Adding Maven Dependencies
3233

3334
```XML
3435
<dependencies>
@@ -40,9 +41,9 @@ IoTDB provides a Java native client driver and a session pool management mechani
4041
</dependencies>
4142
```
4243

43-
## Read and Write Operations
44+
## 2. Read and Write Operations
4445

45-
### ITableSession Interface
46+
### 2.1 ITableSession Interface
4647

4748
The `ITableSession` interface defines basic operations for interacting with IoTDB, including data insertion, query execution, and session closure. Note that this interface is **not thread-safe**.
4849

@@ -124,7 +125,7 @@ public interface ITableSession extends AutoCloseable {
124125
}
125126
```
126127

127-
### TableSessionBuilder Class
128+
### 2.2 TableSessionBuilder Class
128129

129130
The `TableSessionBuilder` class is a builder for configuring and creating instances of the `ITableSession` interface. It allows developers to set connection parameters, query parameters, and security features.
130131

@@ -336,9 +337,9 @@ public class TableSessionBuilder {
336337
}
337338
```
338339

339-
## Session Pool
340+
## 3. Session Pool
340341

341-
### ITableSessionPool Interface
342+
### 3.1 ITableSessionPool Interface
342343

343344
The `ITableSessionPool` interface manages a pool of `ITableSession` instances, enabling efficient reuse of connections and proper cleanup of resources.
344345

@@ -378,7 +379,7 @@ public interface ITableSessionPool {
378379
}
379380
```
380381

381-
### TableSessionPoolBuilder Class
382+
### 3.2 ableSessionPoolBuilder Class
382383

383384
The `TableSessionPoolBuilder` class is a builder for configuring and creating `ITableSessionPool` instances, supporting options like connection settings and pooling behavior.
384385

src/UserGuide/Master/Table/API/Programming-Python-Native-API.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@
1818
under the License.
1919
2020
-->
21+
# Python Native API
2122

2223
IoTDB provides a Python native client driver and a session pool management mechanism. These tools allow developers to interact with IoTDB in a programmatic and efficient manner. Using the Python API, developers can encapsulate time-series data into objects (e.g., `Tablet`, `NumpyTablet`) and insert them into the database directly, without the need to manually construct SQL statements. For multi-threaded operations, the `TableSessionPool` is recommended to optimize resource utilization and enhance performance.
2324

24-
## Prerequisites
25+
## 1. Prerequisites
2526

2627
To use the IoTDB Python API, install the required package using pip:
2728

2829
```Java
2930
pip3 install apache-iotdb
3031
```
3132

32-
## Read and Write Operations
33+
## 2. Read and Write Operations
3334

34-
### TableSession
35+
### 2.1 TableSession
3536

3637
`TableSession` is a core class in IoTDB, enabling users to interact with the IoTDB database. It provides methods to execute SQL statements, insert data, and manage database sessions.
3738

@@ -101,7 +102,7 @@ def close(self):
101102
pass
102103
```
103104

104-
### TableSessionConfig
105+
### 2.2 TableSessionConfig
105106

106107
`TableSessionConfig` is a configuration class that sets parameters for creating a `TableSession` instance, defining essential settings for connecting to the IoTDB database.
107108

@@ -159,9 +160,9 @@ class TableSessionConfig(object):
159160

160161
**Note:** After using a `TableSession`, make sure to call the `close` method to release resources.
161162

162-
## Session Pool
163+
## 3. Session Pool
163164

164-
### TableSessionPool
165+
### 3.1 TableSessionPool
165166

166167
`TableSessionPool` is a session pool management class designed for creating and managing `TableSession` instances. It provides functionality to retrieve sessions from the pool and close the pool when it is no longer needed.
167168

@@ -200,7 +201,7 @@ def close(self):
200201
"""
201202
```
202203

203-
### TableSessionPoolConfig
204+
### 3.2 TableSessionPoolConfig
204205

205206
`TableSessionPoolConfig` is a configuration class used to define parameters for initializing and managing a `TableSessionPool` instance. It specifies the settings needed for efficient session pool management in IoTDB.
206207

@@ -276,7 +277,7 @@ class TableSessionPoolConfig(object):
276277
- Ensure that `TableSession` instances retrieved from the `TableSessionPool` are properly closed after use.
277278
- After closing the `TableSessionPool`, it will no longer be possible to retrieve new sessions.
278279

279-
## Sample Code
280+
## 4. Sample Code
280281

281282
**Session** Example: You can find the full example code at [GitHub Repository](https://github.com/apache/iotdb/blob/master/iotdb-client/client-py/table_model_session_example.py).
282283

src/UserGuide/Master/Table/API/RestAPI-V1.md

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
under the License.
1919
2020
-->
21+
# RestAPI V1
2122

2223
IoTDB's RESTful service can be used for querying, writing, and management operations. It uses the OpenAPI standard to define interfaces and generate frameworks.
2324

24-
### Enabling RESTful Service
25+
## 1. Enabling RESTful Service
2526

2627
The RESTful service is disabled by default. To enable it, locate the `conf/iotdb-system.properties` file in the IoTDB installation directory, set `enable_rest_service` to `true`, and then restart the datanode process.
2728

2829
```Properties
2930
enable_rest_service=true
3031
```
3132

32-
### Authentication
33+
## 2. Authentication
3334

3435
Except for the health check endpoint `/ping`, the RESTful service uses basic authentication. Each URL request must include the header `'Authorization':'Basic' + base64.encode(username + ':' + password)`.
3536

@@ -59,9 +60,9 @@ Authorization : Basic cm9vdDpyb290
5960
{"code":800,"message":"INIT_AUTH_ERROR"}
6061
```
6162

62-
### Interface Definitions
63+
## 3. Interface Definitions
6364

64-
#### Ping
65+
### 3.1 Ping
6566

6667
The `/ping` endpoint can be used for online service health checks.
6768

@@ -71,9 +72,9 @@ The `/ping` endpoint can be used for online service health checks.
7172

7273
- Example Request:
7374

74-
```Shell
75+
```Bash
7576
curl http://127.0.0.1:18080/ping
76-
```
77+
```
7778

7879
- HTTP Status Codes:
7980

@@ -102,7 +103,7 @@ The `/ping` endpoint can be used for online service health checks.
102103

103104
**Note**: The `/ping` endpoint does not require authentication.
104105

105-
#### Query Interface
106+
### 3.2 Query Interface
106107

107108
- Request Path: `/rest/table/v1/query`
108109

@@ -130,9 +131,9 @@ The `/ping` endpoint can be used for online service health checks.
130131

131132
- Example Request:
132133

133-
```JSON
134+
```Bash
134135
curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"database":"test","sql":"select s1,s2,s3 from test_table"}' http://127.0.0.1:18080/rest/table/v1/query
135-
```
136+
```
136137

137138
- Example Response:
138139

@@ -161,9 +162,9 @@ The `/ping` endpoint can be used for online service health checks.
161162
]
162163
]
163164
}
164-
```
165+
```
165166

166-
#### Non-Query Interface
167+
### 3.3 Non-Query Interface
167168

168169
- Request Path: `/rest/table/v1/nonQuery`
169170

@@ -208,9 +209,9 @@ The `/ping` endpoint can be used for online service health checks.
208209
"code": 200,
209210
"message": "SUCCESS_STATUS"
210211
}
211-
```
212+
```
212213

213-
#### Batch Write Interface
214+
### 3.4 Batch Write Interface
214215

215216
- Request Path: `/rest/table/v1/insertTablet`
216217

@@ -241,9 +242,9 @@ The `/ping` endpoint can be used for online service health checks.
241242
242243
- Example Request:
243244
244-
```JSON
245+
```Bash
245246
curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"database":"test","column_catogories":["TAG","FIELD","FIELD"],"timestamps":[1739702535000,1739789055000],"column_names":["s1","s2","s3"],"data_types":["STRING","BOOLEAN","INT32"],"values":[["a11",true,2024],["a11",false,2025]],"table":"test_table"}' http://127.0.0.1:18080/rest/table/v1/insertTablet
246-
```
247+
```
247248
248249
- Example Response:
249250
@@ -252,86 +253,86 @@ The `/ping` endpoint can be used for online service health checks.
252253
"code": 200,
253254
"message": "SUCCESS_STATUS"
254255
}
255-
```
256+
```
256257
257-
### Configuration
258+
## 4. Configuration
258259
259260
The configuration file is located in `iotdb-system.properties`.
260261
261262
- Set `enable_rest_service` to `true` to enable the module, or `false` to disable it. The default value is `false`.
262263
263-
```Plain
264+
```Properties
264265
enable_rest_service=true
265-
```
266+
```
266267
267268
- Only effective when `enable_rest_service=true`. Set `rest_service_port` to a number (1025~65535) to customize the REST service socket port. The default value is `18080`.
268269
269-
```Plain
270+
```Properties
270271
rest_service_port=18080
271-
```
272+
```
272273
273274
- Set `enable_swagger` to `true` to enable Swagger for displaying REST interface information, or `false` to disable it. The default value is `false`.
274275
275-
```Plain
276+
```Properties
276277
enable_swagger=false
277-
```
278+
```
278279
279280
- The maximum number of rows that can be returned in a single query. If the result set exceeds this limit, only the rows within the limit will be returned, and status code `411` will be returned.
280281
281-
```Plain
282+
```Properties
282283
rest_query_default_row_size_limit=10000
283-
```
284+
```
284285
285286
- Expiration time for caching client login information (used to speed up user authentication, in seconds, default is 8 hours).
286287
287-
```Plain
288+
```Properties
288289
cache_expire_in_seconds=28800
289-
```
290+
```
290291
291292
- Maximum number of users stored in the cache (default is 100).
292293
293-
```Plain
294+
```Properties
294295
cache_max_num=100
295-
```
296+
```
296297
297298
- Initial cache capacity (default is 10).
298299
299-
```Plain
300+
```Properties
300301
cache_init_num=10
301-
```
302+
```
302303
303304
- Whether to enable SSL configuration for the REST service. Set `enable_https` to `true` to enable it, or `false` to disable it. The default value is `false`.
304305
305-
```Plain
306+
```Properties
306307
enable_https=false
307-
```
308+
```
308309
309310
- Path to the `keyStore` (optional).
310311
311-
```Plain
312+
```Properties
312313
key_store_path=
313-
```
314+
```
314315
315316
- Password for the `keyStore` (optional).
316317
317-
```Plain
318+
```Properties
318319
key_store_pwd=
319-
```
320+
```
320321
321322
- Path to the `trustStore` (optional).
322323
323-
```Plain
324+
```Properties
324325
trust_store_path=""
325-
```
326+
```
326327
327328
- Password for the `trustStore` (optional).
328329
329-
```Plain
330+
```Properties
330331
trust_store_pwd=""
331-
```
332+
```
332333
333334
- SSL timeout time, in seconds.
334335
335-
```Plain
336+
```Properties
336337
idle_timeout_in_seconds=5000
337-
```
338+
```

0 commit comments

Comments
 (0)