From cfc7229b05cb935200c48ce6e48da91eae5fa437 Mon Sep 17 00:00:00 2001 From: leto-bbq Date: Thu, 27 Aug 2026 17:45:08 +0800 Subject: [PATCH] Add RPC compression and encoding config docs for TableSessionBuilder (V2.0.11) --- .../API/Programming-Java-Native-API_apache.md | 122 +++++++++++++++++- .../API/Programming-Java-Native-API_apache.md | 122 +++++++++++++++++- .../API/Programming-Java-Native-API_apache.md | 120 ++++++++++++++++- .../API/Programming-Java-Native-API_apache.md | 120 ++++++++++++++++- 4 files changed, 472 insertions(+), 12 deletions(-) diff --git a/src/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md b/src/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md index 71c5f13d7..9ae21c644 100644 --- a/src/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md +++ b/src/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md @@ -141,11 +141,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan #### 3.2.2 Parameter Configuration +The following table lists the available configuration options and their default values in the `TableSessionBuilder` class: + +Since V2.0.11, `TableSessionBuilder` supports configuring the RPC compression method for Tablets and the encoding method for each data type: + +- enableCompression(boolean enableCompression) enables or disables RPC compression; +- withCompressionType(CompressionType compressionType) specifies the compression method for Tablets; +- The withXxxEncoding(TSEncoding tsEncoding) methods specify the encoding method for the corresponding data types. + | **Parameter** | **Description** | **Default Value** | |-----------------------------------------------------| ------------------------------------------------------------ | ------------------------------------------------- | | nodeUrls(List\ nodeUrls) | Sets the list of IoTDB cluster node URLs. | `Collections.singletonList("``localhost:6667``")` | | username(String username) | Sets the username for the connection. | `"root"` | -| password(String password) | Sets the password for the connection. | `"root"` | +| password(String password) | Sets the password for the connection. | `"TimechoDB@2021"` (the default password is `root` before V2.0.6.x) | | database(String database) | Sets the target database name. | `null` | | queryTimeoutInMs(long queryTimeoutInMs) | Sets the query timeout in milliseconds. | `60000` (1 minute) | | 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 | useSSL(boolean useSSL) | Enables or disables SSL for secure connections. | `false` | | trustStore(String keyStore) | Sets the path to the trust store for SSL connections. | `null` | | trustStorePwd(String keyStorePwd) | Sets the password for the SSL trust store. | `null` | -| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `false` | +| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `true` | +| tabletCompressionMinRowSize(int rowSize) | Sets the minimum number of Tablet rows required to enable RPC compression. | `10` | +| withCompressionType(CompressionType compressionType) | Sets the compression type for Tablets sent by this session. | `CompressionType.UNCOMPRESSED` | +| withTimeStampEncoding(TSEncoding tsEncoding) | Sets the encoding for TIMESTAMP values. | `TSEncoding.TS_2DIFF` | +| withBooleanEncoding(TSEncoding tsEncoding) | Sets the encoding for BOOLEAN values. | `TSEncoding.RLE` | +| withInt32Encoding(TSEncoding tsEncoding) | Sets the encoding for INT32 values. | `TSEncoding.TS_2DIFF` | +| withInt64Encoding(TSEncoding tsEncoding) | Sets the encoding for INT64 values. | `TSEncoding.TS_2DIFF` | +| withFloatEncoding(TSEncoding tsEncoding) | Sets the encoding for FLOAT values. | `TSEncoding.GORILLA` | +| withDoubleEncoding(TSEncoding tsEncoding) | Sets the encoding for DOUBLE values. | `TSEncoding.GORILLA` | +| withStringEncoding(TSEncoding tsEncoding) | Sets the encoding for STRING values. | `TSEncoding.PLAIN` | +| withTextEncoding(TSEncoding tsEncoding) | Sets the encoding for TEXT values. | `TSEncoding.PLAIN` | +| withBlobEncoding(TSEncoding tsEncoding) | Sets the encoding for BLOB values. | `TSEncoding.PLAIN` | +| withDateEncoding(TSEncoding tsEncoding) | Sets the encoding for DATE values. | `TSEncoding.TS_2DIFF` | | connectionTimeoutInMs(int connectionTimeoutInMs) | Sets the connection timeout in milliseconds. | `0` (no timeout) | #### 3.2.3 Sample Code @@ -206,7 +226,7 @@ public class TableSessionBuilder { * * @param password the password. * @return the current {@link TableSessionBuilder} instance. - * @defaultValue "root" + * @defaultValue "TimechoDB@2021" //the default password is root before V2.0.6.x */ public TableSessionBuilder password(String password); @@ -336,6 +356,102 @@ public class TableSessionBuilder { */ public TableSessionBuilder enableCompression(boolean enableCompression); + /** + * Sets the minimum number of Tablet rows required to enable RPC compression. + * + * @param tabletCompressionMinRowSize the minimum number of rows. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize); + + /** + * Sets the compression type for tablets sent by this session. + * + * @param compressionType the compression type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withCompressionType(CompressionType compressionType); + + /** + * Sets the encoding type for TIMESTAMP values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BOOLEAN values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT32 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT64 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for FLOAT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DOUBLE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for STRING values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for TEXT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BLOB values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DATE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding); + /** * Sets the connection timeout in milliseconds. * diff --git a/src/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md b/src/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md index 71c5f13d7..9ae21c644 100644 --- a/src/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md +++ b/src/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md @@ -141,11 +141,19 @@ The `TableSessionBuilder` class is a builder for configuring and creating instan #### 3.2.2 Parameter Configuration +The following table lists the available configuration options and their default values in the `TableSessionBuilder` class: + +Since V2.0.11, `TableSessionBuilder` supports configuring the RPC compression method for Tablets and the encoding method for each data type: + +- enableCompression(boolean enableCompression) enables or disables RPC compression; +- withCompressionType(CompressionType compressionType) specifies the compression method for Tablets; +- The withXxxEncoding(TSEncoding tsEncoding) methods specify the encoding method for the corresponding data types. + | **Parameter** | **Description** | **Default Value** | |-----------------------------------------------------| ------------------------------------------------------------ | ------------------------------------------------- | | nodeUrls(List\ nodeUrls) | Sets the list of IoTDB cluster node URLs. | `Collections.singletonList("``localhost:6667``")` | | username(String username) | Sets the username for the connection. | `"root"` | -| password(String password) | Sets the password for the connection. | `"root"` | +| password(String password) | Sets the password for the connection. | `"TimechoDB@2021"` (the default password is `root` before V2.0.6.x) | | database(String database) | Sets the target database name. | `null` | | queryTimeoutInMs(long queryTimeoutInMs) | Sets the query timeout in milliseconds. | `60000` (1 minute) | | 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 | useSSL(boolean useSSL) | Enables or disables SSL for secure connections. | `false` | | trustStore(String keyStore) | Sets the path to the trust store for SSL connections. | `null` | | trustStorePwd(String keyStorePwd) | Sets the password for the SSL trust store. | `null` | -| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `false` | +| enableCompression(boolean enableCompression) | Enables or disables RPC compression for the connection. | `true` | +| tabletCompressionMinRowSize(int rowSize) | Sets the minimum number of Tablet rows required to enable RPC compression. | `10` | +| withCompressionType(CompressionType compressionType) | Sets the compression type for Tablets sent by this session. | `CompressionType.UNCOMPRESSED` | +| withTimeStampEncoding(TSEncoding tsEncoding) | Sets the encoding for TIMESTAMP values. | `TSEncoding.TS_2DIFF` | +| withBooleanEncoding(TSEncoding tsEncoding) | Sets the encoding for BOOLEAN values. | `TSEncoding.RLE` | +| withInt32Encoding(TSEncoding tsEncoding) | Sets the encoding for INT32 values. | `TSEncoding.TS_2DIFF` | +| withInt64Encoding(TSEncoding tsEncoding) | Sets the encoding for INT64 values. | `TSEncoding.TS_2DIFF` | +| withFloatEncoding(TSEncoding tsEncoding) | Sets the encoding for FLOAT values. | `TSEncoding.GORILLA` | +| withDoubleEncoding(TSEncoding tsEncoding) | Sets the encoding for DOUBLE values. | `TSEncoding.GORILLA` | +| withStringEncoding(TSEncoding tsEncoding) | Sets the encoding for STRING values. | `TSEncoding.PLAIN` | +| withTextEncoding(TSEncoding tsEncoding) | Sets the encoding for TEXT values. | `TSEncoding.PLAIN` | +| withBlobEncoding(TSEncoding tsEncoding) | Sets the encoding for BLOB values. | `TSEncoding.PLAIN` | +| withDateEncoding(TSEncoding tsEncoding) | Sets the encoding for DATE values. | `TSEncoding.TS_2DIFF` | | connectionTimeoutInMs(int connectionTimeoutInMs) | Sets the connection timeout in milliseconds. | `0` (no timeout) | #### 3.2.3 Sample Code @@ -206,7 +226,7 @@ public class TableSessionBuilder { * * @param password the password. * @return the current {@link TableSessionBuilder} instance. - * @defaultValue "root" + * @defaultValue "TimechoDB@2021" //the default password is root before V2.0.6.x */ public TableSessionBuilder password(String password); @@ -336,6 +356,102 @@ public class TableSessionBuilder { */ public TableSessionBuilder enableCompression(boolean enableCompression); + /** + * Sets the minimum number of Tablet rows required to enable RPC compression. + * + * @param tabletCompressionMinRowSize the minimum number of rows. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize); + + /** + * Sets the compression type for tablets sent by this session. + * + * @param compressionType the compression type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withCompressionType(CompressionType compressionType); + + /** + * Sets the encoding type for TIMESTAMP values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BOOLEAN values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT32 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT64 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for FLOAT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DOUBLE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for STRING values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for TEXT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BLOB values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DATE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding); + /** * Sets the connection timeout in milliseconds. * diff --git a/src/zh/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md b/src/zh/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md index 42afb1ded..4919b16c2 100644 --- a/src/zh/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md +++ b/src/zh/UserGuide/Master/Table/API/Programming-Java-Native-API_apache.md @@ -146,11 +146,17 @@ TableSessionBuilder类是一个构建器,用于配置和创建ITableSession接 以下是TableSessionBuilder类中可用的配置选项及其默认值: +自 V2.0.11 起,TableSessionBuilder 支持配置 Tablet 的 RPC 压缩方式及各数据类型的编码方式: + +- enableCompression(boolean enableCompression) 用于开启或关闭 RPC 压缩; +- withCompressionType(CompressionType compressionType) 用于指定 Tablet 的压缩方式; +- 各 withXxxEncoding(TSEncoding tsEncoding) 方法用于指定对应数据类型的编码方式。 + | **配置项** | **描述** | **默认值** | | ---------------------------------------------------- | ---------------------------------------- | ------------------------------------------- | | nodeUrls(List`` nodeUrls) | 设置IoTDB集群的节点URL列表 | Collections.singletonList("localhost:6667") | | username(String username) | 设置连接的用户名 | "root" | -| password(String password) | 设置连接的密码 | "root" | +| password(String password) | 设置连接的密码 | "TimechoDB@2021"(V2.0.6.x 之前默认密码是 root) | | database(String database) | 设置目标数据库名称 | null | | queryTimeoutInMs(long queryTimeoutInMs) | 设置查询超时时间(毫秒) | 60000(1分钟) | | fetchSize(int fetchSize) | 设置查询结果的获取大小 | 5000 | @@ -164,7 +170,19 @@ TableSessionBuilder类是一个构建器,用于配置和创建ITableSession接 | useSSL(boolean useSSL) | 是否启用SSL安全连接 | false | | trustStore(String keyStore) | 设置SSL连接的信任库路径 | null | | trustStorePwd(String keyStorePwd) | 设置SSL连接的信任库密码 | null | -| enableCompression(boolean enableCompression) | 是否启用RPC压缩 | false | +| enableCompression(boolean enableCompression) | 是否启用RPC压缩 | true | +| tabletCompressionMinRowSize(int rowSize) | 启用 RPC 压缩所需的最小 Tablet 行数 | 10 | +| withCompressionType(CompressionType compressionType) | 设置该Session发送的Tablet所使用的压缩方式 | CompressionType.UNCOMPRESSED | +| withTimeStampEncoding(TSEncoding tsEncoding) | 设置TIMESTAMP类型的编码方式 | TSEncoding.TS_2DIFF | +| withBooleanEncoding(TSEncoding tsEncoding) | 设置BOOLEAN类型的编码方式 | TSEncoding.RLE | +| withInt32Encoding(TSEncoding tsEncoding) | 设置INT32类型的编码方式 | TSEncoding.TS_2DIFF | +| withInt64Encoding(TSEncoding tsEncoding) | 设置INT64类型的编码方式 | TSEncoding.TS_2DIFF | +| withFloatEncoding(TSEncoding tsEncoding) | 设置FLOAT类型的编码方式 | TSEncoding.GORILLA | +| withDoubleEncoding(TSEncoding tsEncoding) | 设置DOUBLE类型的编码方式 | TSEncoding.GORILLA | +| withStringEncoding(TSEncoding tsEncoding) | 设置STRING类型的编码方式 | TSEncoding.PLAIN | +| withTextEncoding(TSEncoding tsEncoding) | 设置TEXT类型的编码方式 | TSEncoding.PLAIN | +| withBlobEncoding(TSEncoding tsEncoding) | 设置BLOB类型的编码方式 | TSEncoding.PLAIN | +| withDateEncoding(TSEncoding tsEncoding) | 设置DATE类型的编码方式 | TSEncoding.TS_2DIFF | | connectionTimeoutInMs(int connectionTimeoutInMs) | 设置连接超时时间(毫秒) | 0(无超时) | #### 3.2.3 接口展示 @@ -211,7 +229,7 @@ public class TableSessionBuilder { * * @param password the password. * @return the current {@link TableSessionBuilder} instance. - * @defaultValue "root" + * @defaultValue "TimechoDB@2021" //V2.0.6.x 之前默认密码是root */ public TableSessionBuilder password(String password); @@ -341,6 +359,102 @@ public class TableSessionBuilder { */ public TableSessionBuilder enableCompression(boolean enableCompression); + /** + * Sets the minimum number of Tablet rows required to enable RPC compression. + * + * @param tabletCompressionMinRowSize the minimum number of rows. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize); + + /** + * Sets the compression type for tablets sent by this session. + * + * @param compressionType the compression type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withCompressionType(CompressionType compressionType); + + /** + * Sets the encoding type for TIMESTAMP values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BOOLEAN values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT32 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT64 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for FLOAT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DOUBLE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for STRING values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for TEXT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BLOB values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DATE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding); + /** * Sets the connection timeout in milliseconds. * diff --git a/src/zh/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md b/src/zh/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md index 42afb1ded..4919b16c2 100644 --- a/src/zh/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md +++ b/src/zh/UserGuide/latest-Table/API/Programming-Java-Native-API_apache.md @@ -146,11 +146,17 @@ TableSessionBuilder类是一个构建器,用于配置和创建ITableSession接 以下是TableSessionBuilder类中可用的配置选项及其默认值: +自 V2.0.11 起,TableSessionBuilder 支持配置 Tablet 的 RPC 压缩方式及各数据类型的编码方式: + +- enableCompression(boolean enableCompression) 用于开启或关闭 RPC 压缩; +- withCompressionType(CompressionType compressionType) 用于指定 Tablet 的压缩方式; +- 各 withXxxEncoding(TSEncoding tsEncoding) 方法用于指定对应数据类型的编码方式。 + | **配置项** | **描述** | **默认值** | | ---------------------------------------------------- | ---------------------------------------- | ------------------------------------------- | | nodeUrls(List`` nodeUrls) | 设置IoTDB集群的节点URL列表 | Collections.singletonList("localhost:6667") | | username(String username) | 设置连接的用户名 | "root" | -| password(String password) | 设置连接的密码 | "root" | +| password(String password) | 设置连接的密码 | "TimechoDB@2021"(V2.0.6.x 之前默认密码是 root) | | database(String database) | 设置目标数据库名称 | null | | queryTimeoutInMs(long queryTimeoutInMs) | 设置查询超时时间(毫秒) | 60000(1分钟) | | fetchSize(int fetchSize) | 设置查询结果的获取大小 | 5000 | @@ -164,7 +170,19 @@ TableSessionBuilder类是一个构建器,用于配置和创建ITableSession接 | useSSL(boolean useSSL) | 是否启用SSL安全连接 | false | | trustStore(String keyStore) | 设置SSL连接的信任库路径 | null | | trustStorePwd(String keyStorePwd) | 设置SSL连接的信任库密码 | null | -| enableCompression(boolean enableCompression) | 是否启用RPC压缩 | false | +| enableCompression(boolean enableCompression) | 是否启用RPC压缩 | true | +| tabletCompressionMinRowSize(int rowSize) | 启用 RPC 压缩所需的最小 Tablet 行数 | 10 | +| withCompressionType(CompressionType compressionType) | 设置该Session发送的Tablet所使用的压缩方式 | CompressionType.UNCOMPRESSED | +| withTimeStampEncoding(TSEncoding tsEncoding) | 设置TIMESTAMP类型的编码方式 | TSEncoding.TS_2DIFF | +| withBooleanEncoding(TSEncoding tsEncoding) | 设置BOOLEAN类型的编码方式 | TSEncoding.RLE | +| withInt32Encoding(TSEncoding tsEncoding) | 设置INT32类型的编码方式 | TSEncoding.TS_2DIFF | +| withInt64Encoding(TSEncoding tsEncoding) | 设置INT64类型的编码方式 | TSEncoding.TS_2DIFF | +| withFloatEncoding(TSEncoding tsEncoding) | 设置FLOAT类型的编码方式 | TSEncoding.GORILLA | +| withDoubleEncoding(TSEncoding tsEncoding) | 设置DOUBLE类型的编码方式 | TSEncoding.GORILLA | +| withStringEncoding(TSEncoding tsEncoding) | 设置STRING类型的编码方式 | TSEncoding.PLAIN | +| withTextEncoding(TSEncoding tsEncoding) | 设置TEXT类型的编码方式 | TSEncoding.PLAIN | +| withBlobEncoding(TSEncoding tsEncoding) | 设置BLOB类型的编码方式 | TSEncoding.PLAIN | +| withDateEncoding(TSEncoding tsEncoding) | 设置DATE类型的编码方式 | TSEncoding.TS_2DIFF | | connectionTimeoutInMs(int connectionTimeoutInMs) | 设置连接超时时间(毫秒) | 0(无超时) | #### 3.2.3 接口展示 @@ -211,7 +229,7 @@ public class TableSessionBuilder { * * @param password the password. * @return the current {@link TableSessionBuilder} instance. - * @defaultValue "root" + * @defaultValue "TimechoDB@2021" //V2.0.6.x 之前默认密码是root */ public TableSessionBuilder password(String password); @@ -341,6 +359,102 @@ public class TableSessionBuilder { */ public TableSessionBuilder enableCompression(boolean enableCompression); + /** + * Sets the minimum number of Tablet rows required to enable RPC compression. + * + * @param tabletCompressionMinRowSize the minimum number of rows. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder tabletCompressionMinRowSize(int tabletCompressionMinRowSize); + + /** + * Sets the compression type for tablets sent by this session. + * + * @param compressionType the compression type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withCompressionType(CompressionType compressionType); + + /** + * Sets the encoding type for TIMESTAMP values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTimeStampEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BOOLEAN values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBooleanEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT32 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt32Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for INT64 values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withInt64Encoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for FLOAT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withFloatEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DOUBLE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDoubleEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for STRING values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withStringEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for TEXT values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withTextEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for BLOB values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withBlobEncoding(TSEncoding tsEncoding); + + /** + * Sets the encoding type for DATE values. + * + * @param tsEncoding the encoding type. + * @return the current {@link TableSessionBuilder} instance. + */ + public TableSessionBuilder withDateEncoding(TSEncoding tsEncoding); + /** * Sets the connection timeout in milliseconds. *