feat: make SegmentMeta.with_max_doc public (#2499)

* 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
This commit is contained in:
Tri
2024-09-23 14:39:36 +10:00
committed by GitHub
parent 55b0b52457
commit 8bd6eb06e6
4 changed files with 10 additions and 7 deletions

View File

@@ -174,7 +174,9 @@ impl<'a> SelectCursor<RowId> for OptionalIndexSelectCursor<'a> {
} }
impl Set<RowId> for OptionalIndex { 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. // Check if value at position is not null.
#[inline] #[inline]
fn contains(&self, row_id: RowId) -> bool { fn contains(&self, row_id: RowId) -> bool {

View File

@@ -123,7 +123,9 @@ impl<'a> SelectCursor<u16> for DenseBlockSelectCursor<'a> {
} }
impl<'a> Set<u16> for DenseBlock<'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)] #[inline(always)]
fn contains(&self, el: u16) -> bool { fn contains(&self, el: u16) -> bool {

View File

@@ -32,7 +32,9 @@ impl<'a> SelectCursor<u16> for SparseBlock<'a> {
} }
impl<'a> Set<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)] #[inline(always)]
fn contains(&self, el: u16) -> bool { fn contains(&self, el: u16) -> bool {

View File

@@ -176,10 +176,7 @@ impl SegmentMeta {
} }
/// Updates the max_doc value from the `SegmentMeta`. /// Updates the max_doc value from the `SegmentMeta`.
/// pub fn with_max_doc(self, max_doc: u32) -> 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 {
assert_eq!(self.tracked.max_doc, 0); assert_eq!(self.tracked.max_doc, 0);
assert!(self.tracked.deletes.is_none()); assert!(self.tracked.deletes.is_none());
let tracked = self.tracked.map(move |inner_meta| InnerSegmentMeta { let tracked = self.tracked.map(move |inner_meta| InnerSegmentMeta {