pub struct SegmentManager { /* private fields */ }Expand description
Manages segment lifecycle
Implementations§
Source§impl SegmentManager
impl SegmentManager
Sourcepub fn new(policy: CompactionPolicy) -> Self
pub fn new(policy: CompactionPolicy) -> Self
Create new segment manager
Sourcepub fn add_segment(&self, segment: Segment)
pub fn add_segment(&self, segment: Segment)
Add segment
Sourcepub fn get_segment(&self, id: SegmentId) -> Option<Segment>
pub fn get_segment(&self, id: SegmentId) -> Option<Segment>
Get segment
Sourcepub fn mark_deleted(&self, id: SegmentId, count: usize)
pub fn mark_deleted(&self, id: SegmentId, count: usize)
Mark vectors as deleted in segment
Sourcepub fn record_quantizer_error(&self, id: SegmentId, error: f32)
pub fn record_quantizer_error(&self, id: SegmentId, error: f32)
Record quantizer error for segment
Sourcepub fn maybe_compact(&self) -> Vec<CompactionJob>
pub fn maybe_compact(&self) -> Vec<CompactionJob>
Check if compaction is needed and return jobs
Sourcepub fn execute_compaction(
&self,
job: &CompactionJob,
) -> Result<Option<Segment>, CompactionError>
pub fn execute_compaction( &self, job: &CompactionJob, ) -> Result<Option<Segment>, CompactionError>
Execute compaction job
Sourcepub fn clean_tombstones(&self) -> Vec<SegmentId>
pub fn clean_tombstones(&self) -> Vec<SegmentId>
Clean tombstoned segments
Sourcepub fn stats(&self) -> ManagerStats
pub fn stats(&self) -> ManagerStats
Get statistics
Sourcepub fn versions(&self) -> &VersionManager
pub fn versions(&self) -> &VersionManager
Get version manager
Auto Trait Implementations§
impl !Freeze for SegmentManager
impl !RefUnwindSafe for SegmentManager
impl Send for SegmentManager
impl Sync for SegmentManager
impl Unpin for SegmentManager
impl UnsafeUnpin for SegmentManager
impl UnwindSafe for SegmentManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more