pub struct AsyncQuantLoadContext {
pub metadata: AsyncIndexMetadata,
pub num_frozen_points: NonZeroUsize,
pub metric: Metric,
pub prefetch_lookahead: Option<usize>,
pub is_disk_index: bool,
pub prefetch_cache_line_level: Option<PrefetchCacheLineLevel>,
}Expand description
Indicates that the canonical layout for a Quant index is expected for deserialization.
For a file-path prefix prefix, this layout includes the following files:
Common:
prefix: The file that contains the saved graph.prefix.data: The serialized full-precision data in.binform.
Depending on the quantization method used, one of the following sets of files will also be present:
If Product Quantization (PQ) is used:
prefix_build_pq_pivots.bin: The saved PQ pivot table.prefix_build_pq_compressed.bin: The saved PQ codes.
If Scalar Quantization (SQ) is used:
prefix_sq_compressed.bin: The saved scalar quantized codes.prefix_scalar_quantizer_proto.bin: The saved scalar quantizer metadata.
Fields§
§metadata: AsyncIndexMetadataThe file path prefix of the index.
num_frozen_points: NonZeroUsizeThe number of frozen points stored in the datasets.
metric: MetricThe metric to use for this index.
prefetch_lookahead: Option<usize>The number of iterations to prefetch when performing bulk-retrievals.
is_disk_index: boolTemporary parameter to indicate if the index is a disk index to load right file names. This can be removed once disk index uses same file names as async index.
prefetch_cache_line_level: Option<PrefetchCacheLineLevel>controls the prefetch cache line level for the index.
Trait Implementations§
Source§impl<U, V, D, Ctx> LoadWith<AsyncQuantLoadContext> for DefaultProvider<U, V, D, Ctx>where
U: VectorStore + LoadWith<AsyncQuantLoadContext>,
V: VectorStore + AsyncFriendly + LoadWith<AsyncQuantLoadContext>,
D: AsyncFriendly + LoadWith<usize>,
ANNError: From<U::Error> + From<V::Error> + From<D::Error>,
Ctx: ExecutionContext,
impl<U, V, D, Ctx> LoadWith<AsyncQuantLoadContext> for DefaultProvider<U, V, D, Ctx>where
U: VectorStore + LoadWith<AsyncQuantLoadContext>,
V: VectorStore + AsyncFriendly + LoadWith<AsyncQuantLoadContext>,
D: AsyncFriendly + LoadWith<usize>,
ANNError: From<U::Error> + From<V::Error> + From<D::Error>,
Ctx: ExecutionContext,
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
self form disk using provider for IO-related needs. Argument auxiliary
can be arbitrary metadata required for a successful operation, such as file paths.Source§impl LoadWith<AsyncQuantLoadContext> for FastMemoryQuantVectorProviderAsync
impl LoadWith<AsyncQuantLoadContext> for FastMemoryQuantVectorProviderAsync
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
Load the quant vector provider using the prefix in ctx~ as a prefix to [PQPathNames`] along with the number of PQ bytes.
Source§impl<T> LoadWith<AsyncQuantLoadContext> for FastMemoryVectorProviderAsync<T>where
T: VectorRepr,
impl<T> LoadWith<AsyncQuantLoadContext> for FastMemoryVectorProviderAsync<T>where
T: VectorRepr,
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
Load the dataset to a file beginning with the prefix and ending in .data.
The format of the serialized should be in the traditional .bin format.
Source§impl LoadWith<AsyncQuantLoadContext> for MemoryQuantVectorProviderAsync
impl LoadWith<AsyncQuantLoadContext> for MemoryQuantVectorProviderAsync
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
Load the quant vector provider using the prefix in ctx~ as a prefix to [PQPathNames`] along with the number of PQ bytes.
Source§impl<T> LoadWith<AsyncQuantLoadContext> for MemoryVectorProviderAsync<T>where
T: VectorRepr,
impl<T> LoadWith<AsyncQuantLoadContext> for MemoryVectorProviderAsync<T>where
T: VectorRepr,
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
Load the dataset to a file beginning with the prefix and ending in .data.
The format of the serialized should be in the traditional .bin format.
Source§impl LoadWith<AsyncQuantLoadContext> for NoStore
impl LoadWith<AsyncQuantLoadContext> for NoStore
Source§async fn load_with<P>(_: &P, _: &AsyncQuantLoadContext) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(_: &P, _: &AsyncQuantLoadContext) -> ANNResult<Self>where
P: StorageReadProvider,
self form disk using provider for IO-related needs. Argument auxiliary
can be arbitrary metadata required for a successful operation, such as file paths.Source§impl<const NBITS: usize> LoadWith<AsyncQuantLoadContext> for SQStore<NBITS>where
Unsigned: Representation<NBITS>,
impl<const NBITS: usize> LoadWith<AsyncQuantLoadContext> for SQStore<NBITS>where
Unsigned: Representation<NBITS>,
Source§async fn load_with<P>(
read_provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
read_provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
self form disk using provider for IO-related needs. Argument auxiliary
can be arbitrary metadata required for a successful operation, such as file paths.Source§impl LoadWith<AsyncQuantLoadContext> for SimpleNeighborProviderAsync<u32>
This is an adaptor for compatibility with the async index serialization.
impl LoadWith<AsyncQuantLoadContext> for SimpleNeighborProviderAsync<u32>
This is an adaptor for compatibility with the async index serialization.
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncQuantLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
self form disk using provider for IO-related needs. Argument auxiliary
can be arbitrary metadata required for a successful operation, such as file paths.Auto Trait Implementations§
impl Freeze for AsyncQuantLoadContext
impl RefUnwindSafe for AsyncQuantLoadContext
impl Send for AsyncQuantLoadContext
impl Sync for AsyncQuantLoadContext
impl Unpin for AsyncQuantLoadContext
impl UnsafeUnpin for AsyncQuantLoadContext
impl UnwindSafe for AsyncQuantLoadContext
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
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>
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>
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