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 (#6951) #8612

Merged
28 changes: 23 additions & 5 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,20 +599,38 @@ Usage:
}
```

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

Use this command to query all Regions starting from a key.
Use this command to query all Regions in a given range `[startkey, endkey)`. Ranges without `endKey`s are supported.

Usage:
The `limit` parameter limits the number of keys. The default value of `limit` is `16`, and the value of `-1` means unlimited keys.

{{< copyable "" >}}
Usage:

```bash
>> region startkey --format=raw abc
>> region keys --format=raw a // Display all Regions that start from the key a with a default limit count of 16
{
"count": 16,
"regions": [......],
}

>> region keys --format=raw a z // Display all Regions in the range [a, z) with a default limit count of 16
{
"count": 16,
"regions": [......],
}

>> region keys --format=raw a z -1 // Display all Regions in the range [a, z) without a limit count
{
"count": ...,
"regions": [......],
}

>> region keys --format=raw a "" 20 // Display all Regions that start from the key a with a limit count of 20
{
"count": 20,
"regions": [......],
}
```

### `region store <store_id>`
Expand Down