Add order flag to tree get-subtree #1360

Merged
fyrchik merged 1 commit from elebedeva/frostfs-node:feat/subtree-add-order-flag into master 2024-09-11 11:30:29 +00:00
Member

Close #1331

Added --ordered flag to sort output by ascending FileName.

Unordered:

❯ frostfs-cli tree get-subtree --cid DNJN8EiCnEza5geSyGh8MKF6GQmPSn4w9VrCvHhd2cGd --tid testt -r s01.frostfs.devenv:8080 -w wallet.json
Enter password > 
Node ID: [0]
        Parent ID:  [0]
        Timestamp:  [0]
Node ID: [201220989354194625]
        Parent ID:  [0]
        Timestamp:  [1]
        Meta pairs: 
                FileName: ..
Node ID: [6552610496216095863]
        Parent ID:  [201220989354194625]
        Timestamp:  [2]
        Meta pairs: 
                FileName: testrtree
Node ID: [8406937974014259486]
        Parent ID:  [6552610496216095863]
        Timestamp:  [3]
        Meta pairs: 
                FileName: adir
Node ID: [8556780507737303097]
        Parent ID:  [8406937974014259486]
        Timestamp:  [8]
        Meta pairs: 
                FileName: bobj
Node ID: [927535384381270509]
        Parent ID:  [8556780507737303097]
        Timestamp:  [9]
Node ID: [8942633568586414997]
        Parent ID:  [8406937974014259486]
        Timestamp:  [4]
        Meta pairs: 
                FileName: cobj
Node ID: [7898614190921753341]
        Parent ID:  [8942633568586414997]
        Timestamp:  [5]
Node ID: [3140269587020027825]
        Parent ID:  [8406937974014259486]
        Timestamp:  [6]
        Meta pairs: 
                FileName: aobj
Node ID: [8169969682585367037]
        Parent ID:  [3140269587020027825]
        Timestamp:  [7]

Ordered:

❯ frostfs-cli tree get-subtree --cid DNJN8EiCnEza5geSyGh8MKF6GQmPSn4w9VrCvHhd2cGd --tid testt -r s01.frostfs.devenv:8080 -w wallet.json --ordered true
Enter password > 
Node ID: [0]
        Parent ID:  [0]
        Timestamp:  [0]
Node ID: [201220989354194625]
        Parent ID:  [0]
        Timestamp:  [1]
        Meta pairs: 
                FileName: ..
Node ID: [6552610496216095863]
        Parent ID:  [201220989354194625]
        Timestamp:  [2]
        Meta pairs: 
                FileName: testrtree
Node ID: [8406937974014259486]
        Parent ID:  [6552610496216095863]
        Timestamp:  [3]
        Meta pairs: 
                FileName: adir
Node ID: [3140269587020027825]
        Parent ID:  [8406937974014259486]
        Timestamp:  [6]
        Meta pairs: 
                FileName: aobj
Node ID: [8169969682585367037]
        Parent ID:  [3140269587020027825]
        Timestamp:  [7]
Node ID: [8556780507737303097]
        Parent ID:  [8406937974014259486]
        Timestamp:  [8]
        Meta pairs: 
                FileName: bobj
Node ID: [927535384381270509]
        Parent ID:  [8556780507737303097]
        Timestamp:  [9]
Node ID: [8942633568586414997]
        Parent ID:  [8406937974014259486]
        Timestamp:  [4]
        Meta pairs: 
                FileName: cobj
Node ID: [7898614190921753341]
        Parent ID:  [8942633568586414997]
        Timestamp:  [5]

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

Close #1331 Added `--ordered` flag to sort output by ascending FileName. Unordered: ``` ❯ frostfs-cli tree get-subtree --cid DNJN8EiCnEza5geSyGh8MKF6GQmPSn4w9VrCvHhd2cGd --tid testt -r s01.frostfs.devenv:8080 -w wallet.json Enter password > Node ID: [0] Parent ID: [0] Timestamp: [0] Node ID: [201220989354194625] Parent ID: [0] Timestamp: [1] Meta pairs: FileName: .. Node ID: [6552610496216095863] Parent ID: [201220989354194625] Timestamp: [2] Meta pairs: FileName: testrtree Node ID: [8406937974014259486] Parent ID: [6552610496216095863] Timestamp: [3] Meta pairs: FileName: adir Node ID: [8556780507737303097] Parent ID: [8406937974014259486] Timestamp: [8] Meta pairs: FileName: bobj Node ID: [927535384381270509] Parent ID: [8556780507737303097] Timestamp: [9] Node ID: [8942633568586414997] Parent ID: [8406937974014259486] Timestamp: [4] Meta pairs: FileName: cobj Node ID: [7898614190921753341] Parent ID: [8942633568586414997] Timestamp: [5] Node ID: [3140269587020027825] Parent ID: [8406937974014259486] Timestamp: [6] Meta pairs: FileName: aobj Node ID: [8169969682585367037] Parent ID: [3140269587020027825] Timestamp: [7] ``` Ordered: ``` ❯ frostfs-cli tree get-subtree --cid DNJN8EiCnEza5geSyGh8MKF6GQmPSn4w9VrCvHhd2cGd --tid testt -r s01.frostfs.devenv:8080 -w wallet.json --ordered true Enter password > Node ID: [0] Parent ID: [0] Timestamp: [0] Node ID: [201220989354194625] Parent ID: [0] Timestamp: [1] Meta pairs: FileName: .. Node ID: [6552610496216095863] Parent ID: [201220989354194625] Timestamp: [2] Meta pairs: FileName: testrtree Node ID: [8406937974014259486] Parent ID: [6552610496216095863] Timestamp: [3] Meta pairs: FileName: adir Node ID: [3140269587020027825] Parent ID: [8406937974014259486] Timestamp: [6] Meta pairs: FileName: aobj Node ID: [8169969682585367037] Parent ID: [3140269587020027825] Timestamp: [7] Node ID: [8556780507737303097] Parent ID: [8406937974014259486] Timestamp: [8] Meta pairs: FileName: bobj Node ID: [927535384381270509] Parent ID: [8556780507737303097] Timestamp: [9] Node ID: [8942633568586414997] Parent ID: [8406937974014259486] Timestamp: [4] Meta pairs: FileName: cobj Node ID: [7898614190921753341] Parent ID: [8942633568586414997] Timestamp: [5] ``` Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva added the
enhancement
frostfs-cli
labels 2024-09-09 18:35:00 +00:00
elebedeva added 2 commits 2024-09-09 18:35:01 +00:00
Added `--ordered` flag to sort output by ascending FileName.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
[#1331] *: Remove outdated FIXME
All checks were successful
DCO action / DCO (pull_request) Successful in 1m1s
Vulncheck / Vulncheck (pull_request) Successful in 1m28s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m8s
Build / Build Components (pull_request) Successful in 2m15s
Tests and linters / Run gofumpt (pull_request) Successful in 2m6s
Tests and linters / gopls check (pull_request) Successful in 2m34s
Tests and linters / Staticcheck (pull_request) Successful in 2m39s
Tests and linters / Lint (pull_request) Successful in 3m29s
Tests and linters / Tests (pull_request) Successful in 3m36s
Tests and linters / Tests with -race (pull_request) Successful in 3m42s
1a8271ec65
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
fyrchik reviewed 2024-09-10 03:31:20 +00:00
@ -86,8 +86,6 @@ var listContainersCmd = &cobra.Command{
if flagVarListPrintAttr {
cnr.IterateAttributes(func(key, val string) {
if !strings.HasPrefix(key, container.SysAttributePrefix) && !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) {
// FIXME(@cthulhu-rider): https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/97
Owner

Why do you think it is outdated?

Why do you think it is outdated?
Author
Member

Referenced issue is closed and there are no references to other issues, so I suppose it's outdated. Am I wrong?

Referenced issue is closed and there are no references to other issues, so I suppose it's outdated. Am I wrong?
Owner

Yes you are, this FIXME was intended to be fixed after the linked issue closes.
The next line clarifies the intention: Use dedicated method to skip system attributes..
Dedicated method was added exactly in the linked issue, we may use it now.

Yes you are, this FIXME was intended to be fixed _after_ the linked issue closes. The next line clarifies the intention: `Use dedicated method to skip system attributes.`. Dedicated method was added exactly in the linked issue, we may use it now.
Author
Member

Ok, dropped this commit.

Ok, dropped this commit.
Owner

tree: is for service, lets use cli: or cli/tree:

`tree:` is for service, lets use `cli: ` or `cli/tree:`
dstepanov-yadro approved these changes 2024-09-10 12:07:54 +00:00
elebedeva force-pushed feat/subtree-add-order-flag from 1a8271ec65 to e6530f21ae 2024-09-10 13:38:39 +00:00 Compare
achuprov approved these changes 2024-09-10 13:48:54 +00:00
aarifullin approved these changes 2024-09-11 11:15:46 +00:00
fyrchik merged commit dea6f031f9 into master 2024-09-11 11:30:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 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#1360
No description provided.