Adding paging method to query service store iterator #3357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3044
Added
Page
methods to iterators.Re-ordered iterator methods for consistency.
Updated iterator fakes.
Added tests for pagination in iterators.
Notes:
The order or objects returned by
i.result.Hits
inindexerIterator
, unlikesqliterator
is mostly reverse (to the order the objects are seeded) and slightly inconsistent (this part needs to be re-checked, but I saw items for the first page returns in the order ofname-7, name-6, name-5
orname-7, name-5, name-6
).Because of different behavior of
sqliterator
andindexerIterator
, which implement the sameIterator
interface, when calling thePage
method forsqliterator
, you need only to specify the initial offset, the iterator will advance its index automatically by calling Next. But withindexerIterator
, you need to specify the offset each time when calling thePage
method.But the above-mentioned issues are of no concern to using
Page
methods during cleanup. If we need different iterator behavior later, we can research it further and rework it in another issue.Testing:
sqliterator
andindexerIterator
is described in tests. For now, just runto make sure pagination works as expected.