Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ReadLinearStore for Historical #632

Merged

Conversation

danlaine
Copy link

@danlaine danlaine commented Apr 12, 2024

Adds type Layer and uses it in LayeredReader. This generalizes LayeredReader so that it's logic is basically, "if the index I'm looking for is in the diff, use that. Otherwise use the parent."

For a Historical, the diff is all the values written in the next revision. i.e. to read from a Historical, read from its parent, unless the index we're reading was overwritten in the parent. Note that the parent is the revision after this one.

For a Proposed, the diff is all the values written in the proposal. i.e. to read from a Proposed, read from its parent, unless the index we're reading was overwritten in the Proposed. Note the parent is the revision before this one.

Uses LayeredReader to implement Historical::stream_from.

Adds a size field to Historical to implement Historical::size. This seems the most straightforward way to do this. When we're creating the Historical, we know how big it is, so might as well just hold onto that information.

@danlaine danlaine self-assigned this Apr 12, 2024
@danlaine danlaine marked this pull request as ready for review April 17, 2024 20:30
@danlaine danlaine merged commit aafd6e5 into rkuris/new-node-store-interface Apr 18, 2024
@danlaine danlaine deleted the danlaine/implement-historical branch April 18, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants