Repository navigation
Split SegmentEntry into appendable and non-appendable part - #8047
Conversation
📝 WalkthroughWalkthroughThe PR splits the previous single SegmentEntry trait into an immutable base trait NonAppendableSegmentEntry (read-only accessors, search/rescore APIs, versioning, point_version, is_proxy) and a mutable extension trait SegmentEntry (reintroduces mutating methods). Implementations were reorganized to implement NonAppendableSegmentEntry for read paths and SegmentEntry for mutating surfaces; many call sites, locks, and tests were updated to accept or import NonAppendableSegmentEntry. Public re-exports were updated to expose both traits. No algorithmic control-flow changes are introduced beyond the API/trait surface reorganization. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
51d9311 to
4493f63
Compare
Add `ImmutableSegmentEntry` for operations that can be applied to immutable segments, and make the `SegmentEntry` as it subtrait.
4493f63 to
4de0281
Compare
It differs semantically from `ImmutableSegmentEntry` by allowing point deletion. Move point deletion to the trait too.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@lib/segment/src/segment/entry.rs`:
- Around line 39-40: Update the doc comment that references the old trait name
"ImmutableSegmentEntry" to use the current trait name
"NonAppendableSegmentEntry" so the comment matches the code; search for
occurrences of ImmutableSegmentEntry in the comment block above the
implementation (the doc that begins "This is a basic implementation of
`ImmutableSegmentEntry`") and replace them with `NonAppendableSegmentEntry`,
keeping the rest of the text intact and preserving backticks/formatting.
| /// This is a basic implementation of `ImmutableSegmentEntry`, meaning that it implements the _actual_ operations with data and | ||
| /// not any kind of proxy or wrapping. |
There was a problem hiding this comment.
Update doc comment to the new trait name.
It still says ImmutableSegmentEntry, but the trait is now NonAppendableSegmentEntry.
Suggested fix
-/// This is a basic implementation of `ImmutableSegmentEntry`, meaning that it implements the _actual_ operations with data and
+/// This is a basic implementation of `NonAppendableSegmentEntry`, meaning that it implements the _actual_ operations with data and📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /// This is a basic implementation of `ImmutableSegmentEntry`, meaning that it implements the _actual_ operations with data and | |
| /// not any kind of proxy or wrapping. | |
| /// This is a basic implementation of `NonAppendableSegmentEntry`, meaning that it implements the _actual_ operations with data and | |
| /// not any kind of proxy or wrapping. |
🤖 Prompt for AI Agents
In `@lib/segment/src/segment/entry.rs` around lines 39 - 40, Update the doc
comment that references the old trait name "ImmutableSegmentEntry" to use the
current trait name "NonAppendableSegmentEntry" so the comment matches the code;
search for occurrences of ImmutableSegmentEntry in the comment block above the
implementation (the doc that begins "This is a basic implementation of
`ImmutableSegmentEntry`") and replace them with `NonAppendableSegmentEntry`,
keeping the rest of the text intact and preserving backticks/formatting.
SegmentEntry into mutable and immutable partSegmentEntry into appendable and non-appendable part
* Split `SegmentEntry` Add `ImmutableSegmentEntry` for operations that can be applied to immutable segments, and make the `SegmentEntry` as it subtrait. * Rename to `NonAppendableSegmentEntry` It differs semantically from `ImmutableSegmentEntry` by allowing point deletion. Move point deletion to the trait too. * Fix docstring * use NonAppendableSegmentEntry where possible --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
* Split `SegmentEntry` Add `ImmutableSegmentEntry` for operations that can be applied to immutable segments, and make the `SegmentEntry` as it subtrait. * Rename to `NonAppendableSegmentEntry` It differs semantically from `ImmutableSegmentEntry` by allowing point deletion. Move point deletion to the trait too. * Fix docstring * use NonAppendableSegmentEntry where possible --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
Add
NonAppendableSegmentEntryfor operations that can be applied to non-appendable segments, and make theSegmentEntryits subtrait.All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --workspace --all-featurescommand?Changes to Core Features: