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

feat: Implement stateful cursor #13

Merged
merged 4 commits into from
May 28, 2022
Merged

feat: Implement stateful cursor #13

merged 4 commits into from
May 28, 2022

Conversation

scarmuega
Copy link
Member

This PR introduces a stateful cursor in a similar fashion to the one in Oura.

This works by using the same storage plugin configured for the actual data output. The value of the cursor is scoped for a specific pipeline (aka: Scrolls process). When the pipeline starts, it queries the storage plugin to get the value of the cursor. If we find a value, it will override any "intersect" configuration and use the cursor instead.

The cursor is updated each time a block is done with all reducer algorithms. This introduces a new requirement: reducers need to be synchronized at the block level. Meaning, we can't have reducers sending update commands from one block while a different reducer is still processing the previous block. To enforce we'll need to merge each reducer algorithm into a single stage and parallelize the process within the scope of a block.

@scarmuega scarmuega marked this pull request as ready for review May 28, 2022 01:38
@scarmuega scarmuega requested a review from rvcas May 28, 2022 01:38
CRDTCommand::block_starting(block),
))?;

for reducer in self.reducers.iter_mut() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where we plan to use rayon or something to do these in parallel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly

@scarmuega scarmuega merged commit 01fe154 into main May 28, 2022
@scarmuega scarmuega deleted the feat/cursor branch May 28, 2022 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants