Sort items by default in frostfs-cli output #694

Merged
dstepanov-yadro merged 3 commits from elebedeva/frostfs-node:sort-output into master 2024-09-04 19:51:03 +00:00
Member

Close #333

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Close #333 Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva requested review from storage-core-developers 2023-09-18 07:22:19 +00:00
elebedeva requested review from storage-core-committers 2023-09-18 07:22:21 +00:00

The task was about all the commands, but not specifically about shards list. I suggest we consider a more global solution.

The task was about all the commands, but not specifically about `shards list`. I suggest we consider a more global solution.
elebedeva changed title from Sort items by shard ID in frostfs-cli output to WIP: Sort items by shard ID in frostfs-cli output 2023-09-18 08:24:33 +00:00
elebedeva force-pushed sort-output from bb668977e0 to 5841e163fc 2023-09-20 15:29:55 +00:00 Compare
elebedeva force-pushed sort-output from 5841e163fc to 394458fa92 2023-09-25 07:05:48 +00:00 Compare
elebedeva changed title from WIP: Sort items by shard ID in frostfs-cli output to Sort items by shard ID in frostfs-cli output 2023-09-25 07:06:50 +00:00
aarifullin reviewed 2023-09-25 08:03:39 +00:00
@ -72,0 +78,4 @@
tmp2 := make([]byte, 32)
list[i].Encode(tmp1)
list[j].Encode(tmp2)
return bytes.Compare(tmp1, tmp2) < 0
Member

I suppose

func(i, j int) bool {
  lhs, rhs := list[i].EncodeToString(), list[j].EncodeToString()
  return strings.Compare(lhs, rhs) < 0
}

could be much simpler.

Also, I recommend to use lhs, rhs names instead tmp1, tmp2 - these names are common for the such functors

I suppose ```golang func(i, j int) bool { lhs, rhs := list[i].EncodeToString(), list[j].EncodeToString() return strings.Compare(lhs, rhs) < 0 } ``` could be much simpler. Also, I recommend to use `lhs, rhs` names instead `tmp1, tmp2` - these names are common for the such functors
Author
Member

fixed

fixed
aarifullin marked this conversation as resolved
elebedeva force-pushed sort-output from 394458fa92 to b8c3c2486d 2023-09-25 08:31:29 +00:00 Compare
elebedeva changed title from Sort items by shard ID in frostfs-cli output to Sort items by default in frostfs-cli output 2023-09-25 11:52:00 +00:00
aarifullin approved these changes 2023-09-25 11:52:46 +00:00
dstepanov-yadro approved these changes 2023-09-25 11:59:19 +00:00
dstepanov-yadro requested review from acid-ant 2023-09-25 12:00:14 +00:00
acid-ant approved these changes 2023-09-26 06:23:06 +00:00
dstepanov-yadro merged commit b8c3c2486d into master 2023-09-26 06:47:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#694
No description provided.