Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: update the usage of region startkey to region keys #7637

Merged
merged 4 commits into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,16 +806,46 @@ Encoding 格式示例:
}
```

### `region startkey [--format=raw|encode|hex] <key> <limit>`
### `region keys [--format=raw|encode|hex] <start_key> <end_key> <limit>`

用于查询从某个 key 开始的所有 Region。
用于查询从某个 key 范围内的所有 Region。支持不带 `endKey` 的范围。`limit` 的默认值是 16,不带 `endKey` 时的默认值是 `-1`(表示没有限制)。示例如下:

示例:
显示从 a 开始的所有 Region 信息,数量上限为 16:

{{< copyable "" >}}

```bash
>> region keys --format=raw a
```

```
{
"count": 16,
"regions": [......],
}
```

显示从 a 开始的所有 Region 信息,数量上限为 20:

{{< copyable "" >}}

```bash
>> region keys --format=raw a "" 20
```

```
{
"count": 20,
"regions": [......],
}
```

显示 [a, z) 范围内的所有 Region 信息,没有数量上限:

{{< copyable "" >}}

```bash
>> region startkey --format=raw abc
>> region keys --format=raw a z
```

```
Expand All @@ -825,6 +855,21 @@ Encoding 格式示例:
}
```

显示 [a, z) 范围内的所有 Region 信息,数量上限为 20:

{{< copyable "" >}}

```bash
>> region keys --format=raw a z 20
```

```
{
"count": 20,
"regions": [......],
}
```

### `region store <store_id>`

用于查询某个 store 上面所有的 Region。
Expand Down