[#107] Add client method ListFullSubjects #107

Merged
fyrchik merged 1 commit from d.zverev/frostfs-contract:feature/frostfsid-add-list-subjects into master 2024-08-28 09:18:25 +00:00
Contributor

Add ListFullSubjects to frostfsid client. Method slice of Subjects for the given slice of hashes.

Signed-off-by: d.zverev d.zverev@yadro.com

Add ListFullSubjects to frostfsid client. Method slice of Subjects for the given slice of hashes. Signed-off-by: d.zverev <d.zverev@yadro.com>
d.zverev added 1 commit 2024-08-27 09:51:57 +00:00
[] Add client method ListFullSubjects
Some checks reported warnings
DCO action / DCO (pull_request) Has been cancelled
Tests / Tests (1.21) (pull_request) Has been cancelled
Tests / Tests (1.22) (pull_request) Has been cancelled
82b6da56aa
Signed-off-by: d.zverev <d.zverev@yadro.com>
d.zverev force-pushed feature/frostfsid-add-list-subjects from 82b6da56aa to 0ee5ddc02d 2024-08-27 09:52:41 +00:00 Compare
d.zverev changed title from [] Add client method ListFullSubjects to [#107] Add client method ListFullSubjects 2024-08-27 09:53:03 +00:00
d.zverev requested review from storage-core-developers 2024-08-27 10:03:55 +00:00
d.zverev requested review from storage-core-committers 2024-08-27 10:03:56 +00:00
d.zverev force-pushed feature/frostfsid-add-list-subjects from 0ee5ddc02d to b7dfa43884 2024-08-27 10:05:09 +00:00 Compare
acid-ant reviewed 2024-08-27 10:38:44 +00:00
@ -260,6 +265,35 @@ func (c Client) ListSubjects() ([]util.Uint160, error) {
return UnwrapArrayOfUint160(commonclient.ReadIteratorItems(c.act, iteratorBatchSize, c.contract, listSubjectsMethod))
}
// ListSubjects gets list of subjects.
Member

Please update comment accordingly to method.

Please update comment accordingly to method.
Author
Contributor

Fixed.

Fixed.
d.zverev force-pushed feature/frostfsid-add-list-subjects from b7dfa43884 to fa66432137 2024-08-27 10:42:33 +00:00 Compare
fyrchik requested review from dkirillov 2024-08-27 10:54:25 +00:00
fyrchik requested review from storage-services-committers 2024-08-27 10:54:26 +00:00
fyrchik requested review from storage-services-developers 2024-08-27 10:54:26 +00:00
fyrchik requested changes 2024-08-27 10:55:09 +00:00
@ -263,0 +280,4 @@
if invoker.State != vmstate.Halt.String() {
return nil, fmt.Errorf("invocation failed: %s", invoker.FaultException)
}
subjects := make([]*Subject, 0)
Owner

please, just var subjects []*Subject or preallocate with make([]*Subject, 0, len(invoker.Stack))

please, just `var subjects []*Subject` or preallocate with `make([]*Subject, 0, len(invoker.Stack))`
Author
Contributor

Changed to var subjects []*Subject

Changed to `var subjects []*Subject`
fyrchik marked this conversation as resolved
d.zverev force-pushed feature/frostfsid-add-list-subjects from fa66432137 to d6f1c8dfa4 2024-08-27 10:59:14 +00:00 Compare
Owner

@dkirillov waiting for your approval

@dkirillov waiting for your approval
fyrchik approved these changes 2024-08-27 11:49:38 +00:00
dkirillov reviewed 2024-08-27 11:53:35 +00:00
@ -263,0 +280,4 @@
if invoker.State != vmstate.Halt.String() {
return nil, fmt.Errorf("invocation failed: %s", invoker.FaultException)
}
var subjects []*Subject
Member

Should we pre-allocatate memory for slice? It seems we know exact size

Should we pre-allocatate memory for slice? It seems we know exact size
Member

Should we pre-allocatate memory for slice? It seems we know exact size

Should we pre-allocatate memory for slice? It seems we know exact size
Author
Contributor

We can, but according previous comment i choose another option.
I can change it to pre-allocated memory if you prefer this type of definition.

We can, but according previous [comment](https://git.frostfs.info/TrueCloudLab/frostfs-contract/pulls/107#issuecomment-49158) i choose another option. I can change it to pre-allocated memory if you prefer this type of definition.
Author
Contributor

Fixed.

Fixed.
dkirillov marked this conversation as resolved
dkirillov approved these changes 2024-08-27 11:53:45 +00:00
d.zverev force-pushed feature/frostfsid-add-list-subjects from d6f1c8dfa4 to 3fd0e27df4 2024-08-27 12:12:58 +00:00 Compare
dkirillov approved these changes 2024-08-27 12:21:11 +00:00
acid-ant reviewed 2024-08-27 12:22:07 +00:00
@ -263,0 +283,4 @@
subjects := make([]*Subject, 0, len(invoker.Stack))
for _, item := range invoker.Stack {
val := item.Value().([]stackitem.Item)
Member

Do we need val here?

Do we need `val` here?
Author
Contributor

Yes, i miss type conversion check.
Add check.

Yes, i miss type conversion check. Add check.
d.zverev force-pushed feature/frostfsid-add-list-subjects from 3fd0e27df4 to a6eb53ee59 2024-08-27 12:27:12 +00:00 Compare
d.zverev force-pushed feature/frostfsid-add-list-subjects from a6eb53ee59 to 17d3e02136 2024-08-27 12:31:55 +00:00 Compare
acid-ant approved these changes 2024-08-27 12:45:02 +00:00
d.zverev force-pushed feature/frostfsid-add-list-subjects from 17d3e02136 to c142971bfd 2024-08-27 13:18:01 +00:00 Compare
d.zverev requested review from dkirillov 2024-08-27 14:10:48 +00:00
d.zverev requested review from fyrchik 2024-08-27 14:10:52 +00:00
dkirillov approved these changes 2024-08-28 06:16:32 +00:00
fyrchik merged commit c142971bfd into master 2024-08-28 09:18:25 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
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-contract#107
No description provided.