diff --git a/_docs/en/administration/table-env.md b/_docs/en/administration/table-env.md index b0193f41..bbbcd5a5 100644 --- a/_docs/en/administration/table-env.md +++ b/_docs/en/administration/table-env.md @@ -21,8 +21,8 @@ If you want to view specific table environment variables, you need to use the [g Table environment variables have the following characteristics: * Persist the metadata of the table onto Apache Zookeeper. * It can be dynamically modified through the command line, and once the modification is successful, it will be immediately updated to Zookeeper. -* Synchronize the variables though the periodic synchronization message `config_sync` between the meta server and the replica server to take effect on each replica server. -> Due to periodic synchronization, the updated environment variables may not take immediate effect on the replica server, but rather have a delay. This delay time depends on the value of the configuration 'config_sync_interval_ms', which defaults to 30 seconds. +* Synchronize the variables though the periodic synchronization message `config_sync` between the Meta Server and the Replica Server to take effect on each Replica Server. +> Due to periodic synchronization, the updated environment variables may not take immediate effect on the Replica Server, but rather have a delay. This delay time depends on the value of the configuration 'config_sync_interval_ms', which defaults to 30 seconds. * The key of environmental variables is usually separated by `.` for easy classification. The functions currently supported through table environment variables include: @@ -36,79 +36,19 @@ Pegasus provides [Shell commands](/docs/tools/shell/) for manipulating table env ## get_app_envs -Get a list of environment variables, usage: `get_app_envs [-j|--json]` - -示例: -``` ->>> use temp -OK ->>> get_app_envs -[app_envs] -rocksdb.usage_scenario : normal -``` +Refer to: [`get_app_envs` command](/docs/tools/shell/#get_app_envs) ## set_app_envs -设置环境变量,用法:`set_app_envs [key value...]` - -示例: -``` ->>> use temp -OK ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed -``` +Refer to: [`set_app_envs` command](/docs/tools/shell/#set_app_envs) ## del_app_envs -删除环境变量,用法:`del_app_envs [key...]` - -示例: -``` ->>> use temp -OK ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed ->>> del_app_envs rocksdb.usage_scenario -del app envs succeed -============================= -deleted keys: - rocksdb.usage_scenario -============================= -``` +Refer to: [`del_app_envs` command](/docs/tools/shell/#del_app_envs) ## clear_app_envs -清空环境变量,或者叫批量删除环境变量,用法:`clear_app_envs <-a|--all> <-p|--prefix str>` - -支持两种方式: -* 全部清理:使用 `-a` 选项。 -* 通过前缀清理:使用 `-p` 选项指定前缀,匹配时会先自动在前缀后面加上 `.`,然后按照字符串前缀匹配。 - -譬如: -``` ->>> use temp -OK ->>> set_app_envs manual_compact.once.trigger_time 1713700000 -set app envs succeed ->>> set_app_envs manual_compact.once.target_level -1 -set app envs succeed ->>> set_app_envs manual_compact.once.bottommost_level_compaction force -set app envs succeed ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed ->>> clear_app_envs -p manual_compact -clear app envs succeed -============================= -deleted keys: - manual_compact.once.bottommost_level_compaction - manual_compact.once.target_level - manual_compact.once.trigger_time -============================= ->>> get_app_envs -[app_envs] -rocksdb.usage_scenario : bulk_load -``` +Refer to: [`clear_app_envs` command](/docs/tools/shell/#clear_app_envs) # Supported environment variables diff --git a/_docs/en/tools/shell.md b/_docs/en/tools/shell.md index c94e7b42..33e26ce7 100644 --- a/_docs/en/tools/shell.md +++ b/_docs/en/tools/shell.md @@ -520,10 +520,10 @@ Examples: | create | Create a table, with the option to add `-p` and `-r` to specify the number of partitions and replicas, respectively. The number of partitions must be a power of two. If `-r` is not specified, the default number of replicas is set to 3 (recommended value). | | drop | Delete a table, refer to [use drop commands to delete a table](/administration/table-soft-delete#drop_commands). | | recall | Restore a previously deleted table, refer to [use recall commands to recovery table](/administration/table-soft-delete#recall_commands). | -| get_app_envs | Retrieve the environmental variables of a table, refer to [Table environment#get_app_envs](/administration/table-env#get_app_envs). | -| set_app_envs | Set the environmental variables for a table, refer to [Table environment#set_app_envs](/administration/table-env#set_app_envs). | -| del_app_envs | Delete the environmental variables of a table, refer to [Table environment#del_app_envs](/administration/table-env#del_app_envs). | -| clear_app_envs | Clean up the environmental variables of a table, refer to [Table environment#clear_app_envs](/administration/table-env#clear_app_envs). | +| get_app_envs | Retrieve the environmental variables of a table. | +| set_app_envs | Set the environmental variables for a table. | +| del_app_envs | Delete the environmental variables of a table. | +| clear_app_envs | Clean up the environmental variables of a table. | | add_dup | Add a cluster with duplication, refer to [duplication](/administration/duplication). | | query_dup | Query the clusters for cross-data center synchronization of a table, refer to [duplication](/administration/duplication). | | remove_dup | Remove a cluster with duplication, refer to [duplication](/administration/duplication). | @@ -700,13 +700,16 @@ USAGE: get_app_envs Explanation: -- This command outputs the current environmental variables of the table. Please use `use [app_name]` to select a specific table before executing this command. For reference, see [get_app_envs](/administration/table-env#get_app_envs). +- This command outputs the current environmental variables of the table. Please use `use [app_name]` to select a specific table before executing this command. Examples: ``` >>> use temp +OK >>> get_app_envs +[app_envs] +rocksdb.usage_scenario : normal ``` ### set_app_envs @@ -721,13 +724,15 @@ USAGE: set_app_envs [key value...] Explanation: -- This command will set the current environmental variables of the table. Please use `use [app_name]` to select a specific table before executing this command. For reference, see [get_app_envs](/administration/table-env#get_app_envs). +- This command will set the current environmental variables of the table. Please use `use [app_name]` to select a specific table before executing this command. Examples: ``` >>> use temp +OK >>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed ``` ### del_app_envs @@ -742,13 +747,21 @@ USAGE: del_app_envs [key...] Explanation: -- This command delete the environmental variables of the current table. Please use `use [app_name]` to select a specific table before executing this command. For reference, see [get_app_envs](/administration/table-env#get_app_envs). +- This command deletes the environmental variables of the current table. Please use `use [app_name]` to select a specific table before executing this command. Examples: ``` >>> use temp +OK +>>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed >>> del_app_envs rocksdb.usage_scenario +del app envs succeed +============================= +deleted keys: + rocksdb.usage_scenario +============================= ``` ### clear_app_envs @@ -763,7 +776,7 @@ USAGE: clear_app_envs [-a|--all] [-p|--prefix str] Explanation: -- This command eradicates the present table's environmental variables. Prior to employment, please ensure to employ `use [app_name]` to designate a specific table, as referenced in [clear_app_envs](/administration/table-env#clear_app_envs). +- This command eradicates the present table's environmental variables. Prior to employment, please ensure to employ `use [app_name]` to designate a specific table. - The `-a` option: When specified, it results in the purging of all environmental variables. - The `-p` option: When specified, it allows for the elimination of environmental variables with a specific prefix string. @@ -771,7 +784,26 @@ Examples: ``` >>> use temp ->>> clear_app_envs -p rocksdb +OK +>>> set_app_envs manual_compact.once.trigger_time 1713700000 +set app envs succeed +>>> set_app_envs manual_compact.once.target_level -1 +set app envs succeed +>>> set_app_envs manual_compact.once.bottommost_level_compaction force +set app envs succeed +>>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed +>>> clear_app_envs -p manual_compact +clear app envs succeed +============================= +deleted keys: + manual_compact.once.bottommost_level_compaction + manual_compact.once.target_level + manual_compact.once.trigger_time +============================= +>>> get_app_envs +[app_envs] +rocksdb.usage_scenario : bulk_load ``` ### add_dup diff --git a/_docs/zh/administration/table-env.md b/_docs/zh/administration/table-env.md index 13957a8c..6c99412b 100644 --- a/_docs/zh/administration/table-env.md +++ b/_docs/zh/administration/table-env.md @@ -21,8 +21,8 @@ app_id status app_name app_type partition_count replica_count is_statef Table 环境变量具有如下特性: * 作为 table 的元数据持久化到 Apache Zookeeper 上。 * 可以通过命令行动态修改,修改成功后会立即更新到 Apache Zookeeper 上。 -* 通过 meta server 和 replica server 的周期性同步消息 `config_sync` 同步给各个 replica server 生效。 -> 由于是周期性同步,所以环境变量更新后可能不会在 replica server 上立即生效,而是有一个延迟。这个延迟时间依赖于配置 `config_sync_interval_ms` 的值,默认是 30 秒。 +* 通过 Meta Server 和 Replica Server 的周期性同步消息 `config_sync` 同步给各个 Replica Server 生效。 +> 由于是周期性同步,所以环境变量更新后可能不会在 Replica Server 上立即生效,而是有一个延迟。这个延迟时间依赖于配置 `config_sync_interval_ms` 的值,默认是 30 秒。 * 环境变量的 key 通常使用 `.` 分隔,方便分类。 目前通过 table 环境变量支持的功能如: @@ -35,83 +35,23 @@ Pegasus 的 [Shell 工具](/docs/tools/shell/) 中提供了操作 table 环境 ## get_app_envs -获取环境变量列表,用法:`get_app_envs [-j|--json]` - -示例: -``` ->>> use temp -OK ->>> get_app_envs -[app_envs] -rocksdb.usage_scenario : normal -``` +参考:[`get_app_envs` 命令](/docs/tools/shell/#get_app_envs) ## set_app_envs -设置环境变量,用法:`set_app_envs [key value...]` - -示例: -``` ->>> use temp -OK ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed -``` +参考:[`set_app_envs` 命令](/docs/tools/shell/#set_app_envs) ## del_app_envs -删除环境变量,用法:`del_app_envs [key...]` - -示例: -``` ->>> use temp -OK ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed ->>> del_app_envs rocksdb.usage_scenario -del app envs succeed -============================= -deleted keys: - rocksdb.usage_scenario -============================= -``` +参考:[`del_app_envs` 命令](/docs/tools/shell/#del_app_envs) ## clear_app_envs -清空环境变量,或者叫批量删除环境变量,用法:`clear_app_envs <-a|--all> <-p|--prefix str>` - -支持两种方式: -* 全部清理:使用 `-a` 选项。 -* 通过前缀清理:使用 `-p` 选项指定前缀,匹配时会先自动在前缀后面加上 `.`,然后按照字符串前缀匹配。 - -譬如: -``` ->>> use temp -OK ->>> set_app_envs manual_compact.once.trigger_time 1713700000 -set app envs succeed ->>> set_app_envs manual_compact.once.target_level -1 -set app envs succeed ->>> set_app_envs manual_compact.once.bottommost_level_compaction force -set app envs succeed ->>> set_app_envs rocksdb.usage_scenario bulk_load -set app envs succeed ->>> clear_app_envs -p manual_compact -clear app envs succeed -============================= -deleted keys: - manual_compact.once.bottommost_level_compaction - manual_compact.once.target_level - manual_compact.once.trigger_time -============================= ->>> get_app_envs -[app_envs] -rocksdb.usage_scenario : bulk_load -``` +参考:[`clear_app_envs` 命令](/docs/tools/shell/#clear_app_envs) # 支持的环境变量 -从 Pegasus 2.6 开始,可通过 meta server 的 [HTTP 接口](/api/http) `/envs/list` 获取所有支持的 table 环境变量。 +从 Pegasus 2.6 开始,可通过 Meta Server 的 [HTTP 接口](/api/http) `/envs/list` 获取所有支持的 table 环境变量。 例如: ``` diff --git a/_docs/zh/tools/shell.md b/_docs/zh/tools/shell.md index dfea2ed6..891635e4 100755 --- a/_docs/zh/tools/shell.md +++ b/_docs/zh/tools/shell.md @@ -505,10 +505,10 @@ USAGE:disk_capacity [-n|--node replica_server(ip:port)][-o|--out file | create | 创建表,可加`-p`和`-r`选项指定分片数和副本数,要求分片数是 2 的指数倍,不指定 -r 则默认副本数为 3(推荐值)| | drop | 删除表,参见[使用 drop 命令删除表](/administration/table-soft-delete#使用drop命令删除表) | | recall | 恢复已删除的表,参见[使用 recall 命令恢复表](/administration/table-soft-delete#使用recall命令恢复表) | -| get_app_envs | 获取表的环境变量,参见 [Table 环境变量#get_app_envs](/administration/table-env#get_app_envs) | -| set_app_envs | 设置表的环境变量,参见 [Table 环境变量#set_app_envs](/administration/table-env#set_app_envs) | -| del_app_envs | 删除表的环境变量,参见 [Table 环境变量#del_app_envs](/administration/table-env#del_app_envs) | -| clear_app_envs | 清理表的环境变量,参见 [Table 环境变量#clear_app_envs](/administration/table-env#clear_app_envs) | +| get_app_envs | 获取表的环境变量 | +| set_app_envs | 设置表的环境变量 | +| del_app_envs | 删除表的环境变量 | +| clear_app_envs | 清理表的环境变量 | | add_dup | 添加 duplication 的集群,参见[跨机房同步](/administration/duplication) | | query_dup | 查询表的跨机房同步的集群, 参加[跨机房同步](/administration/duplication) | | remove_dup | 移除 duplication 的集群, 参见[跨机房同步](/administration/duplication) | @@ -685,13 +685,16 @@ USAGE: get_app_envs 说明: -- 该命令输出当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表,参见 [get_app_envs](/administration/table-env#get_app_envs)。 +- 该命令输出当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表。 示例: ``` >>> use temp +OK >>> get_app_envs +[app_envs] +rocksdb.usage_scenario : normal ``` ### set_app_envs @@ -706,13 +709,15 @@ USAGE: set_app_envs [key value...] 说明: -- 该命令设置当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表,参见 [set_app_envs](/administration/table-env#set_app_envs)。 +- 该命令设置当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表。 示例: ``` >>> use temp +OK >>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed ``` ### del_app_envs @@ -727,13 +732,21 @@ USAGE: del_app_envs [key...] 说明: -- 该命令删除当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表,参见 [del_app_envs](/administration/table-env#del_app_envs)。 +- 该命令删除当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表。 示例: ``` >>> use temp +OK +>>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed >>> del_app_envs rocksdb.usage_scenario +del app envs succeed +============================= +deleted keys: + rocksdb.usage_scenario +============================= ``` ### clear_app_envs @@ -748,7 +761,7 @@ USAGE: clear_app_envs [-a|--all] [-p|--prefix str] 说明: -- 该命令删除当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表,参见 [clear_app_envs](/administration/table-env#clear_app_envs)。 +- 该命令删除当前表的环境变量,使用前请首先使用`use [app_name]`选定特定表。 - `-a`选项:如果指定,则清理所有的环境变量。 - `-p`选项:如果指定,则可以清理以特定字符串为前缀的环境变量。 @@ -756,7 +769,26 @@ USAGE: clear_app_envs [-a|--all] [-p|--prefix str] ``` >>> use temp ->>> clear_app_envs -p rocksdb +OK +>>> set_app_envs manual_compact.once.trigger_time 1713700000 +set app envs succeed +>>> set_app_envs manual_compact.once.target_level -1 +set app envs succeed +>>> set_app_envs manual_compact.once.bottommost_level_compaction force +set app envs succeed +>>> set_app_envs rocksdb.usage_scenario bulk_load +set app envs succeed +>>> clear_app_envs -p manual_compact +clear app envs succeed +============================= +deleted keys: + manual_compact.once.bottommost_level_compaction + manual_compact.once.target_level + manual_compact.once.trigger_time +============================= +>>> get_app_envs +[app_envs] +rocksdb.usage_scenario : bulk_load ``` ### add_dup