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

Smarter state with timestampPath #19

Open
pietercolpaert opened this issue Mar 14, 2024 · 1 comment
Open

Smarter state with timestampPath #19

pietercolpaert opened this issue Mar 14, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pietercolpaert
Copy link
Member

pietercolpaert commented Mar 14, 2024

The state can be kept more efficiently, even without immutable caching headers, when the timestampPath is set:

The state then may become:

  • The last processed timestamp, and the IRI of all members on that timestamp
  • The rootnode and its expiration timestamp, or the fact the root is immutable
  • The border node’s expiration or the fact they became immutable
    • All visited nodes that were reachable from a non bounded relation (i.e. there’s a greaterThanRelation, but not a lessThanRelation when traversing in ascending order), and also don’t match the bounds of their parents,
    • non-timestamp-based relations, and also don’t match the bounds of their parents, and
    • all currently on-going nodes (lessThan timestamps did not reach the time of our iterator yet)

All relations that point at earlier data can be forgotten.

@pietercolpaert pietercolpaert added the enhancement New feature or request label Mar 14, 2024
@pietercolpaert
Copy link
Member Author

A more concise rewrite of the above:

Given that:

  1. an ldes:timestampPath is set,
  2. a relation uses that timestampPath in the relation, and
  3. we’re processing chronologically (ascending)

Then, when the relation points at something that is earlier than the current time we’re processing, a client can ignore the relation and not include it in the state.

The state however needs to be extended with:

  1. The fact timestampPath can be taken into account and the last processed timestamp
  2. The IRIs of all members on that timestamp that were already processed (otherwise, a member on exactly that timestamp might be emitted a second time when resuming)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants