pub struct MultiInsert<DP, T, S>where
DP: DataProvider,{ /* private fields */ }Expand description
A built-in helper for benchmarking multi-insert.
This is intended to be used in conjunction with crate::build::build and crate::build::build_tracked.
§Notes
The multi-insert API for diskann::graph::DiskANNIndex parallelizes insertion internally. When using
crate::build::build, users should use crate::build::Parallelism::sequential.
Implementations§
Source§impl<DP, T, S> MultiInsert<DP, T, S>where
DP: DataProvider,
impl<DP, T, S> MultiInsert<DP, T, S>where
DP: DataProvider,
Sourcepub fn new<I>(
index: Arc<DiskANNIndex<DP>>,
data: Arc<Matrix<T>>,
strategy: S,
to_id: I,
) -> Arc<Self>where
I: ToId<DP::ExternalId>,
pub fn new<I>(
index: Arc<DiskANNIndex<DP>>,
data: Arc<Matrix<T>>,
strategy: S,
to_id: I,
) -> Arc<Self>where
I: ToId<DP::ExternalId>,
Construct a new MultiInsert builder for the given index.
Vectors will be inserted using all rows of data with strategy used
for the diskann::graph::glue::InsertStrategy.
Parameter to_id will be used to convert row indices of data (0..data.nrows())
to external IDs.
Trait Implementations§
Source§impl<DP, T, S> Build for MultiInsert<DP, T, S>where
DP: DataProvider<Context: Default> + for<'a> SetElement<&'a [T]>,
S: MultiInsertStrategy<DP, Matrix<T>> + Clone + 'static,
T: AsyncFriendly + Clone,
impl<DP, T, S> Build for MultiInsert<DP, T, S>where
DP: DataProvider<Context: Default> + for<'a> SetElement<&'a [T]>,
S: MultiInsertStrategy<DP, Matrix<T>> + Clone + 'static,
T: AsyncFriendly + Clone,
Source§type Output = ()
type Output = ()
Custom output parameters. This augments the standard metrics collected by
build and
allows implementation-specific data to be returned.Source§fn num_data(&self) -> usize
fn num_data(&self) -> usize
Return the number of data points to build the index over. The machinery in
build and
build_tracked will partition the range 0..num_data() into disjoint ranges and call
Build::build on each range in an unspecified order.Source§async fn build(&self, range: Range<usize>) -> ANNResult<Self::Output>
async fn build(&self, range: Range<usize>) -> ANNResult<Self::Output>
Insert the data points specified by the range. Implementations may assume that the range is
non-empty, within
0..num_data(), and disjoint from other ranges passed to concurrent calls
while in build or build_tracked. Read moreAuto Trait Implementations§
impl<DP, T, S> Freeze for MultiInsert<DP, T, S>where
S: Freeze,
impl<DP, T, S> !RefUnwindSafe for MultiInsert<DP, T, S>
impl<DP, T, S> Send for MultiInsert<DP, T, S>
impl<DP, T, S> Sync for MultiInsert<DP, T, S>
impl<DP, T, S> Unpin for MultiInsert<DP, T, S>where
S: Unpin,
impl<DP, T, S> UnsafeUnpin for MultiInsert<DP, T, S>where
S: UnsafeUnpin,
impl<DP, T, S> !UnwindSafe for MultiInsert<DP, T, S>
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> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
Errors that can occur during
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Perform the actual conversion. Read more
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Write a description of the dispatch rule and outcome to the formatter. Read more
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
The equivalent of
try_match but returns a reason for a failed score. Read more