pub struct CompactionManager { /* private fields */ }Expand description
Global compaction manager for all namespaces
Implementations§
Source§impl CompactionManager
impl CompactionManager
Sourcepub fn new(config: CompactionConfig) -> Self
pub fn new(config: CompactionConfig) -> Self
Create a new compaction manager
Sourcepub fn namespace(&self, namespace: &NamespaceId) -> Arc<NamespaceSegmentManager>
pub fn namespace(&self, namespace: &NamespaceId) -> Arc<NamespaceSegmentManager>
Get or create namespace manager
Sourcepub fn add(&self, namespace: &NamespaceId, vector: Vector)
pub fn add(&self, namespace: &NamespaceId, vector: Vector)
Add a vector to a namespace
Sourcepub fn get(&self, namespace: &NamespaceId, id: &VectorId) -> Option<Vector>
pub fn get(&self, namespace: &NamespaceId, id: &VectorId) -> Option<Vector>
Get a vector from a namespace
Sourcepub fn delete(&self, namespace: &NamespaceId, id: &VectorId) -> bool
pub fn delete(&self, namespace: &NamespaceId, id: &VectorId) -> bool
Delete a vector from a namespace
Sourcepub fn get_all(&self, namespace: &NamespaceId) -> Vec<Vector>
pub fn get_all(&self, namespace: &NamespaceId) -> Vec<Vector>
Get all vectors in a namespace
Sourcepub fn compact_namespace(
&self,
namespace: &NamespaceId,
) -> Vec<CompactionResult>
pub fn compact_namespace( &self, namespace: &NamespaceId, ) -> Vec<CompactionResult>
Run compaction on a namespace
Sourcepub fn compact_all(&self) -> HashMap<NamespaceId, Vec<CompactionResult>>
pub fn compact_all(&self) -> HashMap<NamespaceId, Vec<CompactionResult>>
Run compaction on all namespaces
Sourcepub fn namespace_stats(&self, namespace: &NamespaceId) -> Option<SegmentStats>
pub fn namespace_stats(&self, namespace: &NamespaceId) -> Option<SegmentStats>
Get statistics for a namespace
Sourcepub fn global_stats(&self) -> GlobalCompactionStats
pub fn global_stats(&self) -> GlobalCompactionStats
Get global statistics
Sourcepub fn delete_namespace(&self, namespace: &NamespaceId) -> bool
pub fn delete_namespace(&self, namespace: &NamespaceId) -> bool
Delete a namespace
Sourcepub fn list_namespaces(&self) -> Vec<NamespaceId> ⓘ
pub fn list_namespaces(&self) -> Vec<NamespaceId> ⓘ
List all namespaces
Auto Trait Implementations§
impl !Freeze for CompactionManager
impl !RefUnwindSafe for CompactionManager
impl Send for CompactionManager
impl Sync for CompactionManager
impl Unpin for CompactionManager
impl UnsafeUnpin for CompactionManager
impl !UnwindSafe for CompactionManager
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
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