This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
split node.slice into node.getByOrigin and node.iterate #397
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.
In its current form
node.slice
is difficult to implement for #351 because it exposes time-based query parameters such asstart_time
,end_time
etc. These are easy to work with when there's access to SQL, but with a KV-storage the implementation has little choice but toiter.next()
or hold all the nodes in memory continuously until iterations are doneLuckily however none of the existing code really uses these time-based queries (except the internals of
node.slice
implementation). All uses ofnode.slice
fall into one of two categories:OriginId
The first category doesn't leverage time-based parameters (calls look like
node.slice({})
). The second does specify them but not because it cares about time -- purely because this makesslice()
emulate what they need.This means that exposure of time-based params is not a necessity right now which allows to split it into two methods, one for each category. Resulting methods are easy to implement in a KV-storage context.