Skip to content

Commit 155c42f

Browse files
authored
Add RPC compression and encoding config docs for TableSessionBuilder (V2.0.11) (#1211)
1 parent cdf74af commit 155c42f

4 files changed

Lines changed: 472 additions & 12 deletions

File tree

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

Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan
141141

142142
#### 3.2.2 Parameter Configuration
143143

144+
The following table lists the available configuration options and their default values in the `TableSessionBuilder` class:
145+
146+
Since V2.0.11, `TableSessionBuilder` supports configuring the RPC compression method for Tablets and the encoding method for each data type:
147+
148+
- enableCompression(boolean enableCompression) enables or disables RPC compression;
149+
- withCompressionType(CompressionType compressionType) specifies the compression method for Tablets;
150+
- The withXxxEncoding(TSEncoding tsEncoding) methods specify the encoding method for the corresponding data types.
151+
144152
| **Parameter** | **Description** | **Default Value** |
145153
|-----------------------------------------------------| ------------------------------------------------------------ | ------------------------------------------------- |
146154
| nodeUrls(List\<String> nodeUrls) | Sets the list of IoTDB cluster node URLs. | `Collections.singletonList("``localhost:6667``")` |
147155
| username(String username) | Sets the username for the connection. | `"root"` |
148-
| password(String password) | Sets the password for the connection. | `"root"` |
156+
| password(String password) | Sets the password for the connection. | `"TimechoDB@2021"` (the default password is `root` before V2.0.6.x) |
149157
| database(String database) | Sets the target database name. | `null` |
150158
| queryTimeoutInMs(long queryTimeoutInMs) | Sets the query timeout in milliseconds. | `60000` (1 minute) |
151159
| fetchSize(int fetchSize) | Sets the fetch size for query results. | `5000` |
@@ -159,7 +167,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan
159167
| useSSL(boolean useSSL) | Enables or disables SSL for secure connections. | `false` |
160168
| trustStore(String keyStore) | Sets the path to the trust store for SSL connections. | `null` |
161169
| trustStorePwd(String keyStorePwd) | Sets the password for the SSL trust store. | `null` |
162-
| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `false` |
170+
| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `true` |
171+
| tabletCompressionMinRowSize(int rowSize) | Sets the minimum number of Tablet rows required to enable RPC compression. | `10` |
172+
| withCompressionType(CompressionType compressionType) | Sets the compression type for Tablets sent by this session. | `CompressionType.UNCOMPRESSED` |
173+
| withTimeStampEncoding(TSEncoding tsEncoding) | Sets the encoding for TIMESTAMP values. | `TSEncoding.TS_2DIFF` |
174+
| withBooleanEncoding(TSEncoding tsEncoding) | Sets the encoding for BOOLEAN values. | `TSEncoding.RLE` |
175+
| withInt32Encoding(TSEncoding tsEncoding) | Sets the encoding for INT32 values. | `TSEncoding.TS_2DIFF` |
176+
| withInt64Encoding(TSEncoding tsEncoding) | Sets the encoding for INT64 values. | `TSEncoding.TS_2DIFF` |
177+
| withFloatEncoding(TSEncoding tsEncoding) | Sets the encoding for FLOAT values. | `TSEncoding.GORILLA` |
178+
| withDoubleEncoding(TSEncoding tsEncoding) | Sets the encoding for DOUBLE values. | `TSEncoding.GORILLA` |
179+
| withStringEncoding(TSEncoding tsEncoding) | Sets the encoding for STRING values. | `TSEncoding.PLAIN` |
180+
| withTextEncoding(TSEncoding tsEncoding) | Sets the encoding for TEXT values. | `TSEncoding.PLAIN` |
181+
| withBlobEncoding(TSEncoding tsEncoding) | Sets the encoding for BLOB values. | `TSEncoding.PLAIN` |
182+
| withDateEncoding(TSEncoding tsEncoding) | Sets the encoding for DATE values. | `TSEncoding.TS_2DIFF` |
163183
| connectionTimeoutInMs(int connectionTimeoutInMs) | Sets the connection timeout in milliseconds. | `0` (no timeout) |
164184

165185
#### 3.2.3 Sample Code
@@ -206,7 +226,7 @@ public class TableSessionBuilder {
206226
*
207227
* @param password the password.
208228
* @return the current {@link TableSessionBuilder} instance.
209-
* @defaultValue "root"
229+
* @defaultValue "TimechoDB@2021" //the default password is root before V2.0.6.x
210230
*/
211231
public TableSessionBuilder password(String password);
212232

@@ -336,6 +356,102 @@ public class TableSessionBuilder {
336356
*/
337357
public TableSessionBuilder enableCompression(boolean enableCompression);
338358

359+
/**
360+
* Sets the minimum number of Tablet rows required to enable RPC compression.
361+
*
362+
* @param tabletCompressionMinRowSize the minimum number of rows.
363+
* @return the current {@link TableSessionBuilder} instance.
364+
*/
365+
public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize);
366+
367+
/**
368+
* Sets the compression type for tablets sent by this session.
369+
*
370+
* @param compressionType the compression type.
371+
* @return the current {@link TableSessionBuilder} instance.
372+
*/
373+
public TableSessionBuilder withCompressionType(CompressionType compressionType);
374+
375+
/**
376+
* Sets the encoding type for TIMESTAMP values.
377+
*
378+
* @param tsEncoding the encoding type.
379+
* @return the current {@link TableSessionBuilder} instance.
380+
*/
381+
public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding);
382+
383+
/**
384+
* Sets the encoding type for BOOLEAN values.
385+
*
386+
* @param tsEncoding the encoding type.
387+
* @return the current {@link TableSessionBuilder} instance.
388+
*/
389+
public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding);
390+
391+
/**
392+
* Sets the encoding type for INT32 values.
393+
*
394+
* @param tsEncoding the encoding type.
395+
* @return the current {@link TableSessionBuilder} instance.
396+
*/
397+
public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding);
398+
399+
/**
400+
* Sets the encoding type for INT64 values.
401+
*
402+
* @param tsEncoding the encoding type.
403+
* @return the current {@link TableSessionBuilder} instance.
404+
*/
405+
public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding);
406+
407+
/**
408+
* Sets the encoding type for FLOAT values.
409+
*
410+
* @param tsEncoding the encoding type.
411+
* @return the current {@link TableSessionBuilder} instance.
412+
*/
413+
public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding);
414+
415+
/**
416+
* Sets the encoding type for DOUBLE values.
417+
*
418+
* @param tsEncoding the encoding type.
419+
* @return the current {@link TableSessionBuilder} instance.
420+
*/
421+
public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding);
422+
423+
/**
424+
* Sets the encoding type for STRING values.
425+
*
426+
* @param tsEncoding the encoding type.
427+
* @return the current {@link TableSessionBuilder} instance.
428+
*/
429+
public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding);
430+
431+
/**
432+
* Sets the encoding type for TEXT values.
433+
*
434+
* @param tsEncoding the encoding type.
435+
* @return the current {@link TableSessionBuilder} instance.
436+
*/
437+
public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding);
438+
439+
/**
440+
* Sets the encoding type for BLOB values.
441+
*
442+
* @param tsEncoding the encoding type.
443+
* @return the current {@link TableSessionBuilder} instance.
444+
*/
445+
public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding);
446+
447+
/**
448+
* Sets the encoding type for DATE values.
449+
*
450+
* @param tsEncoding the encoding type.
451+
* @return the current {@link TableSessionBuilder} instance.
452+
*/
453+
public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding);
454+
339455
/**
340456
* Sets the connection timeout in milliseconds.
341457
*

src/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md

Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan
141141

142142
#### 3.2.2 Parameter Configuration
143143

144+
The following table lists the available configuration options and their default values in the `TableSessionBuilder` class:
145+
146+
Since V2.0.11, `TableSessionBuilder` supports configuring the RPC compression method for Tablets and the encoding method for each data type:
147+
148+
- enableCompression(boolean enableCompression) enables or disables RPC compression;
149+
- withCompressionType(CompressionType compressionType) specifies the compression method for Tablets;
150+
- The withXxxEncoding(TSEncoding tsEncoding) methods specify the encoding method for the corresponding data types.
151+
144152
| **Parameter** | **Description** | **Default Value** |
145153
|-----------------------------------------------------| ------------------------------------------------------------ | ------------------------------------------------- |
146154
| nodeUrls(List\<String> nodeUrls) | Sets the list of IoTDB cluster node URLs. | `Collections.singletonList("``localhost:6667``")` |
147155
| username(String username) | Sets the username for the connection. | `"root"` |
148-
| password(String password) | Sets the password for the connection. | `"root"` |
156+
| password(String password) | Sets the password for the connection. | `"TimechoDB@2021"` (the default password is `root` before V2.0.6.x) |
149157
| database(String database) | Sets the target database name. | `null` |
150158
| queryTimeoutInMs(long queryTimeoutInMs) | Sets the query timeout in milliseconds. | `60000` (1 minute) |
151159
| fetchSize(int fetchSize) | Sets the fetch size for query results. | `5000` |
@@ -159,7 +167,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan
159167
| useSSL(boolean useSSL) | Enables or disables SSL for secure connections. | `false` |
160168
| trustStore(String keyStore) | Sets the path to the trust store for SSL connections. | `null` |
161169
| trustStorePwd(String keyStorePwd) | Sets the password for the SSL trust store. | `null` |
162-
| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `false` |
170+
| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `true` |
171+
| tabletCompressionMinRowSize(int rowSize) | Sets the minimum number of Tablet rows required to enable RPC compression. | `10` |
172+
| withCompressionType(CompressionType compressionType) | Sets the compression type for Tablets sent by this session. | `CompressionType.UNCOMPRESSED` |
173+
| withTimeStampEncoding(TSEncoding tsEncoding) | Sets the encoding for TIMESTAMP values. | `TSEncoding.TS_2DIFF` |
174+
| withBooleanEncoding(TSEncoding tsEncoding) | Sets the encoding for BOOLEAN values. | `TSEncoding.RLE` |
175+
| withInt32Encoding(TSEncoding tsEncoding) | Sets the encoding for INT32 values. | `TSEncoding.TS_2DIFF` |
176+
| withInt64Encoding(TSEncoding tsEncoding) | Sets the encoding for INT64 values. | `TSEncoding.TS_2DIFF` |
177+
| withFloatEncoding(TSEncoding tsEncoding) | Sets the encoding for FLOAT values. | `TSEncoding.GORILLA` |
178+
| withDoubleEncoding(TSEncoding tsEncoding) | Sets the encoding for DOUBLE values. | `TSEncoding.GORILLA` |
179+
| withStringEncoding(TSEncoding tsEncoding) | Sets the encoding for STRING values. | `TSEncoding.PLAIN` |
180+
| withTextEncoding(TSEncoding tsEncoding) | Sets the encoding for TEXT values. | `TSEncoding.PLAIN` |
181+
| withBlobEncoding(TSEncoding tsEncoding) | Sets the encoding for BLOB values. | `TSEncoding.PLAIN` |
182+
| withDateEncoding(TSEncoding tsEncoding) | Sets the encoding for DATE values. | `TSEncoding.TS_2DIFF` |
163183
| connectionTimeoutInMs(int connectionTimeoutInMs) | Sets the connection timeout in milliseconds. | `0` (no timeout) |
164184

165185
#### 3.2.3 Sample Code
@@ -206,7 +226,7 @@ public class TableSessionBuilder {
206226
*
207227
* @param password the password.
208228
* @return the current {@link TableSessionBuilder} instance.
209-
* @defaultValue "root"
229+
* @defaultValue "TimechoDB@2021" //the default password is root before V2.0.6.x
210230
*/
211231
public TableSessionBuilder password(String password);
212232

@@ -336,6 +356,102 @@ public class TableSessionBuilder {
336356
*/
337357
public TableSessionBuilder enableCompression(boolean enableCompression);
338358

359+
/**
360+
* Sets the minimum number of Tablet rows required to enable RPC compression.
361+
*
362+
* @param tabletCompressionMinRowSize the minimum number of rows.
363+
* @return the current {@link TableSessionBuilder} instance.
364+
*/
365+
public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize);
366+
367+
/**
368+
* Sets the compression type for tablets sent by this session.
369+
*
370+
* @param compressionType the compression type.
371+
* @return the current {@link TableSessionBuilder} instance.
372+
*/
373+
public TableSessionBuilder withCompressionType(CompressionType compressionType);
374+
375+
/**
376+
* Sets the encoding type for TIMESTAMP values.
377+
*
378+
* @param tsEncoding the encoding type.
379+
* @return the current {@link TableSessionBuilder} instance.
380+
*/
381+
public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding);
382+
383+
/**
384+
* Sets the encoding type for BOOLEAN values.
385+
*
386+
* @param tsEncoding the encoding type.
387+
* @return the current {@link TableSessionBuilder} instance.
388+
*/
389+
public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding);
390+
391+
/**
392+
* Sets the encoding type for INT32 values.
393+
*
394+
* @param tsEncoding the encoding type.
395+
* @return the current {@link TableSessionBuilder} instance.
396+
*/
397+
public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding);
398+
399+
/**
400+
* Sets the encoding type for INT64 values.
401+
*
402+
* @param tsEncoding the encoding type.
403+
* @return the current {@link TableSessionBuilder} instance.
404+
*/
405+
public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding);
406+
407+
/**
408+
* Sets the encoding type for FLOAT values.
409+
*
410+
* @param tsEncoding the encoding type.
411+
* @return the current {@link TableSessionBuilder} instance.
412+
*/
413+
public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding);
414+
415+
/**
416+
* Sets the encoding type for DOUBLE values.
417+
*
418+
* @param tsEncoding the encoding type.
419+
* @return the current {@link TableSessionBuilder} instance.
420+
*/
421+
public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding);
422+
423+
/**
424+
* Sets the encoding type for STRING values.
425+
*
426+
* @param tsEncoding the encoding type.
427+
* @return the current {@link TableSessionBuilder} instance.
428+
*/
429+
public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding);
430+
431+
/**
432+
* Sets the encoding type for TEXT values.
433+
*
434+
* @param tsEncoding the encoding type.
435+
* @return the current {@link TableSessionBuilder} instance.
436+
*/
437+
public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding);
438+
439+
/**
440+
* Sets the encoding type for BLOB values.
441+
*
442+
* @param tsEncoding the encoding type.
443+
* @return the current {@link TableSessionBuilder} instance.
444+
*/
445+
public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding);
446+
447+
/**
448+
* Sets the encoding type for DATE values.
449+
*
450+
* @param tsEncoding the encoding type.
451+
* @return the current {@link TableSessionBuilder} instance.
452+
*/
453+
public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding);
454+
339455
/**
340456
* Sets the connection timeout in milliseconds.
341457
*

0 commit comments

Comments
 (0)