pub struct Catalog { /* private fields */ }Expand description
Catalog for managing segment metadata using SochDB storage
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn open_memory() -> Result<Self>
pub fn open_memory() -> Result<Self>
Open an in-memory catalog (for testing)
Sourcepub fn create_collection(
&self,
name: &str,
config: &EngineConfig,
) -> Result<i64>
pub fn create_collection( &self, name: &str, config: &EngineConfig, ) -> Result<i64>
Create a new collection
Sourcepub fn get_collection(&self, name: &str) -> Result<CollectionInfo>
pub fn get_collection(&self, name: &str) -> Result<CollectionInfo>
Get collection by name
Sourcepub fn list_collections(&self) -> Result<Vec<CollectionInfo>>
pub fn list_collections(&self) -> Result<Vec<CollectionInfo>>
List all collections
Sourcepub fn add_segment(
&self,
collection_id: i64,
segment: &SegmentInfo,
) -> Result<()>
pub fn add_segment( &self, collection_id: i64, segment: &SegmentInfo, ) -> Result<()>
Register a new segment
Sourcepub fn get_segments(&self, collection_id: i64) -> Result<Vec<SegmentInfo>>
pub fn get_segments(&self, collection_id: i64) -> Result<Vec<SegmentInfo>>
Get all active segments for a collection
Sourcepub fn update_segment_state(
&self,
segment_id: u64,
state: SegmentState,
) -> Result<()>
pub fn update_segment_state( &self, segment_id: u64, state: SegmentState, ) -> Result<()>
Update segment state
Sourcepub fn add_tombstone(
&self,
collection_id: i64,
segment_id: u64,
vec_id: u32,
) -> Result<()>
pub fn add_tombstone( &self, collection_id: i64, segment_id: u64, vec_id: u32, ) -> Result<()>
Add a tombstone
Sourcepub fn clear_tombstones(&self, segment_id: u64) -> Result<()>
pub fn clear_tombstones(&self, segment_id: u64) -> Result<()>
Delete tombstones for a segment (after compaction)
Sourcepub fn get_vector_count(&self, collection_id: i64) -> Result<u64>
pub fn get_vector_count(&self, collection_id: i64) -> Result<u64>
Get total vector count for collection
Sourcepub fn begin_transaction(&self) -> Result<()>
pub fn begin_transaction(&self) -> Result<()>
Begin a transaction
Sourcepub fn checkpoint(&self) -> Result<()>
pub fn checkpoint(&self) -> Result<()>
Execute checkpoint
Auto Trait Implementations§
impl !RefUnwindSafe for Catalog
impl !UnwindSafe for Catalog
impl Freeze for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
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