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: make SegmentMeta.with_max_doc public #2499

Merged
merged 10 commits into from
Sep 23, 2024
4 changes: 3 additions & 1 deletion columnar/src/column_index/optional_index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ impl<'a> SelectCursor<RowId> for OptionalIndexSelectCursor<'a> {
}

impl Set<RowId> for OptionalIndex {
type SelectCursor<'b> = OptionalIndexSelectCursor<'b> where Self: 'b;
type SelectCursor<'b>
= OptionalIndexSelectCursor<'b>
where Self: 'b;
// Check if value at position is not null.
#[inline]
fn contains(&self, row_id: RowId) -> bool {
Expand Down
4 changes: 3 additions & 1 deletion columnar/src/column_index/optional_index/set_block/dense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ impl<'a> SelectCursor<u16> for DenseBlockSelectCursor<'a> {
}

impl<'a> Set<u16> for DenseBlock<'a> {
type SelectCursor<'b> = DenseBlockSelectCursor<'a> where Self: 'b;
type SelectCursor<'b>
= DenseBlockSelectCursor<'a>
where Self: 'b;

#[inline(always)]
fn contains(&self, el: u16) -> bool {
Expand Down
4 changes: 3 additions & 1 deletion columnar/src/column_index/optional_index/set_block/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ impl<'a> SelectCursor<u16> for SparseBlock<'a> {
}

impl<'a> Set<u16> for SparseBlock<'a> {
type SelectCursor<'b> = Self where Self: 'b;
type SelectCursor<'b>
= Self
where Self: 'b;

#[inline(always)]
fn contains(&self, el: u16) -> bool {
Expand Down
5 changes: 1 addition & 4 deletions src/index/index_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ impl SegmentMeta {
}

/// Updates the max_doc value from the `SegmentMeta`.
///
/// This method is only used when updating `max_doc` from 0
/// as we finalize a fresh new segment.
pub(crate) fn with_max_doc(self, max_doc: u32) -> SegmentMeta {
pub fn with_max_doc(self, max_doc: u32) -> SegmentMeta {
assert_eq!(self.tracked.max_doc, 0);
assert!(self.tracked.deletes.is_none());
let tracked = self.tracked.map(move |inner_meta| InnerSegmentMeta {
Expand Down
Loading