Pometry / Pometry/Raphtory

Update earliest_time_global() and latest_time_global() to return TimeIndexEntry instead of i64.

Open
#2,295 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
642
Forks
70
Avg merge
2d 13h
Merged PRs (30d)
21

Description

We should update GraphTimeSemanticsOps::earliest_time_global(), latest_time_global(), earliest_time_window(), and latest_time_window() to return Option<TimeIndexEntry> instead of Option<i64>. The trait is currently defined in "raphtory/src/db/api/view/internal/time_semantics/mod.rs"

Changing it would require for TemporalGraph in "raphtory-core/src/entities/graph/tgraph.rs" to be updated such that it's earliest_time and latest_time fields track secondary indices as well as timestamps. Those fields are currently MinCounter and MaxCounter respectively, which use AtomicI64 types for multi-threaded support, allowing concurrent updates to timestamps while maintaining consistency.

Updating MinCounter and MaxCounter to also track secondary indices without impacting performance is not trivial. The timestamp and secondary index need to stay consistent with one another as they are a pair. Ensuring that this consistency is maintained will likely require a lock, which comes at a performance cost.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GraphTimeSemanticsOps trait in raphtory/src/db/api/view/internal/time_semantics/mod.rs and the TemporalGraph implementation in raphtory-core/src/entities/graph/tgraph.rs. Trace MinCounter and MaxCounter and their concurrent update paths before deciding how paired timestamps and secondary indices can remain consistent. Done means the four methods return Option and TemporalGraph preserves that consistency during updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.