NamespaceManager

Struct NamespaceManager 

Source
pub struct NamespaceManager { /* private fields */ }
Expand description

Multi-tenant namespace manager

Implementations§

Source§

impl NamespaceManager

Source

pub fn new<P: AsRef<Path>>(root_path: P) -> Result<Self>

Create a new namespace manager

Source

pub fn with_quotas<P: AsRef<Path>>( root_path: P, default_quotas: NamespaceQuotas, ) -> Result<Self>

Create a new namespace manager with custom default quotas

Source

pub fn load_namespaces(&self) -> Result<Vec<NamespaceId>>

Load existing namespaces from disk

Source

pub fn create_namespace( &self, id: NamespaceId, name: String, quotas: Option<NamespaceQuotas>, ) -> Result<()>

Create a new namespace

Source

pub fn get_namespace(&self, id: &NamespaceId) -> Result<Namespace>

Get namespace metadata

Source

pub fn list_namespaces(&self) -> Vec<Namespace>

List all namespaces

Source

pub fn update_quotas( &self, id: &NamespaceId, quotas: NamespaceQuotas, ) -> Result<()>

Update namespace quotas

Source

pub fn update_status( &self, id: &NamespaceId, status: NamespaceStatus, ) -> Result<()>

Update namespace status

Source

pub fn delete_namespace(&self, id: &NamespaceId) -> Result<()>

Delete a namespace

Source

pub fn upsert( &self, namespace_id: &NamespaceId, id: String, vector: Vec<f32>, metadata: Metadata, ) -> Result<()>

Upsert a vector in a namespace

Source

pub fn query( &self, namespace_id: &NamespaceId, query: Query, ) -> Result<Vec<Neighbor>>

Query vectors in a namespace

Source

pub fn remove(&self, namespace_id: &NamespaceId, id: &str) -> Result<()>

Delete a vector from a namespace

Source

pub fn get_stats(&self, namespace_id: &NamespaceId) -> Result<NamespaceStats>

Get statistics for a namespace

Source

pub fn get_aggregate_stats(&self) -> AggregateStats

Get aggregate stats across all namespaces

Source

pub fn save_all(&self) -> Result<()>

Persist all namespace metadata

Source

pub fn backup_namespace( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>

Create a backup of a namespace

This creates a snapshot of the namespace’s VecStore and saves it.

§Arguments
  • namespace_id - ID of the namespace to backup
  • backup_name - Name for the backup
§Returns
  • Ok(()) if backup was created successfully
  • Err if namespace doesn’t exist or backup fails
Source

pub fn restore_namespace( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>

Restore a namespace from a backup

This restores a namespace from a previously created snapshot.

§Arguments
  • namespace_id - ID of the namespace to restore
  • backup_name - Name of the backup to restore from
§Returns
  • Ok(()) if restore was successful
  • Err if namespace doesn’t exist or restore fails
Source

pub fn list_namespace_backups( &self, namespace_id: &NamespaceId, ) -> Result<Vec<(String, String, usize)>>

List available backups for a namespace

§Arguments
  • namespace_id - ID of the namespace
§Returns
  • List of (snapshot_name, created_at, record_count) tuples
Source

pub fn delete_namespace_backup( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>

Delete a backup for a namespace

§Arguments
  • namespace_id - ID of the namespace
  • backup_name - Name of the backup to delete

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more