commonclient: Allow to partially unwrap session iterator #64
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-committers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-contract#64
Loading…
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-contract:partial-iterator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Neo-go sessions is a limited resource, but we must use them because the number of items can be unbounded.
With this little helper we can avoid using sessions when the number of items in the iterator is low.
Neo-go has a script for limited iterator expansion, so another option would be to call it and fallback on using sessions.
With this method the unified interface is possible.
RPC usage is covered by the frostfsid-client tests.
aa2e5c6462
to32a1338529
WIP: commonclient: Allow to partially unwrap the iteratorto commonclient: Allow to partially unwrap the iterator32a1338529
to53a32e0cb4
For upstreaming this part see https://github.com/nspcc-dev/neo-go/issues/3272
53a32e0cb4
tocd37475476
commonclient: Allow to partially unwrap the iteratorto commonclient: Allow to partially unwrap session iteratorcd37475476
toff6499b322
@ -18,0 +28,4 @@
return nil, fmt.Errorf("couldn't create unwrap script: %w", err)
}
iter, shouldStop, err := UnwrapPartialIterator(inv.Run(script))
You may ask why is it
PartialUnwrap
above andUnwrapPartial
here.Please, don't.
There are nice suggestions in https://github.com/nspcc-dev/neo-go/issues/3272#issuecomment-1863026141, will fix.
@ -36,0 +84,4 @@
}
arr, ok := itm.Value().([]stackitem.Item)
if !ok {
return Iterator{}, false, errors.New("the item has Array type, but not is not an array")
, but not is not an array
->, but is not an array
ff6499b322
to3fa5691218
3fa5691218
to8750583005
I have updated neo-go and reused everything from https://github.com/nspcc-dev/neo-go/pull/3274
8750583005
to13fb6bab93
13fb6bab93
to5724a7663e