Skip to content

Commit

Permalink
feat: make SegmentMeta.with_max_doc public (#2499)
Browse files Browse the repository at this point in the history
* chore: add container

* feat: make max doc editable externally

* chore: expose another method

* chore: remove comments

* remove unused devcontainer

* chore: manually match nightly format

* chore: change weird formating

* revert format change

* fix: format with nightly
  • Loading branch information
triandco authored Sep 23, 2024
1 parent 55b0b52 commit 8bd6eb0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
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

0 comments on commit 8bd6eb0

Please sign in to comment.