From 259b48df26823b9b9b246cff49f775760171a10f Mon Sep 17 00:00:00 2001 From: JmPotato Date: Thu, 30 Nov 2023 15:56:46 +0800 Subject: [PATCH] Address the comments Signed-off-by: JmPotato --- client/http/client.go | 2 ++ client/http/codec.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/http/client.go b/client/http/client.go index 21b7bea20db6..36355a90d192 100644 --- a/client/http/client.go +++ b/client/http/client.go @@ -358,6 +358,7 @@ func (c *client) GetRegionsByStoreID(ctx context.Context, storeID uint64) (*Regi } // GetRegionsReplicatedStateByKeyRange gets the regions replicated state info by key range. +// The keys in the key range should be encoded in the hex bytes format (without encoding to the UTF-8 bytes). func (c *client) GetRegionsReplicatedStateByKeyRange(ctx context.Context, keyRange *KeyRange) (string, error) { var state string err := c.requestWithRetry(ctx, @@ -411,6 +412,7 @@ func (c *client) GetHistoryHotRegions(ctx context.Context, req *HistoryHotRegion } // GetRegionStatusByKeyRange gets the region status by key range. +// If the `onlyCount` flag is true, the result will only include the count of regions. // The keys in the key range should be encoded in the UTF-8 bytes format. func (c *client) GetRegionStatusByKeyRange(ctx context.Context, keyRange *KeyRange, onlyCount bool) (*RegionStats, error) { var regionStats RegionStats diff --git a/client/http/codec.go b/client/http/codec.go index cac1a89fd87a..26be64b4f283 100644 --- a/client/http/codec.go +++ b/client/http/codec.go @@ -100,7 +100,7 @@ func decodeBytes(b []byte) ([]byte, error) { return buf, nil } -// keyToKeyHexStr converts a raw key to a hex string after encoding. +// rawKeyToKeyHexStr converts a raw key to a hex string after encoding. func rawKeyToKeyHexStr(key []byte) string { if len(key) == 0 { return ""