From 0617789d76e263e552a801f69fc676cb8715d4e2 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Fri, 13 May 2022 13:56:36 +0800 Subject: [PATCH] tools: update the usage of region startkey to region keys (#6951) (#8612) --- pd-control.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/pd-control.md b/pd-control.md index 64eb4f3d210c9..1a68c160aa0b4 100644 --- a/pd-control.md +++ b/pd-control.md @@ -599,20 +599,38 @@ Usage: } ``` -### `region startkey [--format=raw|encode|hex] ` +### `region keys [--format=raw|encode|hex] ` -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 `