Skip to main content

MmapDynamicDiskANN

Struct MmapDynamicDiskANN 

Source
pub struct MmapDynamicDiskANN<T, D>
where T: Pod + Copy + Send + Sync + 'static, D: Distance<T> + Send + Sync + Copy + Clone + 'static,
{ /* private fields */ }
Expand description

A fixed-capacity dynamic index. Vector and u32 adjacency regions have the same row-major mmap layout as DiskANN; version and validity arrays follow.

Implementations§

Source§

impl<T, D> MmapDynamicDiskANN<T, D>
where T: Pod + Copy + Send + Sync + 'static, D: Distance<T> + Send + Sync + Copy + Clone + 'static,

Source

pub fn create_from_static( index: &DiskANN<T, D>, capacity: usize, alpha: f32, path: impl AsRef<Path>, ) -> Result<Self, DiskAnnError>

Source

pub fn open(path: impl AsRef<Path>, dist: D) -> Result<Self, DiskAnnError>

Source

pub fn capacity(&self) -> usize

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn is_valid(&self, id: u32) -> bool

Source

pub fn flush(&self) -> Result<(), DiskAnnError>

Source

pub fn search(&self, query: &[T], k: usize, beam: usize) -> Vec<u32>

Source

pub fn insert( &mut self, vector: Vec<T>, beam: usize, ) -> Result<u32, DiskAnnError>

Source

pub fn insert_batch( &mut self, vectors: Vec<Vec<T>>, beam: usize, ) -> Result<Vec<u32>, DiskAnnError>

Parallel search/planning, followed by deterministic graph commits.

Source

pub fn delete( &mut self, id: u32, repair_beam: usize, repair_degree: usize, ) -> Option<DeleteStats>

Source

pub fn delete_batch( &mut self, ids: &[u32], repair_beam: usize, repair_degree: usize, ) -> Vec<DeleteStats>

MERIT batch deletion: invalidate together, build repair plans in parallel, then commit potentially overlapping adjacency changes deterministically.

Auto Trait Implementations§

§

impl<T, D> Freeze for MmapDynamicDiskANN<T, D>
where D: Freeze, PhantomData<T>: Freeze,

§

impl<T, D> RefUnwindSafe for MmapDynamicDiskANN<T, D>

§

impl<T, D> Send for MmapDynamicDiskANN<T, D>
where PhantomData<T>: Send,

§

impl<T, D> Sync for MmapDynamicDiskANN<T, D>
where PhantomData<T>: Sync,

§

impl<T, D> Unpin for MmapDynamicDiskANN<T, D>
where D: Unpin, PhantomData<T>: Unpin,

§

impl<T, D> UnsafeUnpin for MmapDynamicDiskANN<T, D>

§

impl<T, D> UnwindSafe for MmapDynamicDiskANN<T, D>

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, 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 = !

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

fn try_from(value: U) -> Result<T, !>

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