pub struct DiskProvider<Data>where
Data: GraphDataType<VectorIdType = u32>,{ /* private fields */ }Expand description
The DiskProvider is a data provider that loads data from disk using the disk readers
The data format for disk is different from that of the in-memory providers.
The disk format stores both the vectors and the adjacency list next to each other for
better locality for quicker access.
Please refer to the RFC documentation at [docs\rfcs\cy2025\disk_provider_for_async_index.md] for design details.
Trait Implementations§
Source§impl<Data> DataProvider for DiskProvider<Data>where
Data: GraphDataType<VectorIdType = u32>,
impl<Data> DataProvider for DiskProvider<Data>where
Data: GraphDataType<VectorIdType = u32>,
Source§fn to_internal_id(
&self,
_context: &DefaultContext,
gid: &Self::ExternalId,
) -> Result<Self::InternalId, Self::Error>
fn to_internal_id( &self, _context: &DefaultContext, gid: &Self::ExternalId, ) -> Result<Self::InternalId, Self::Error>
Translate an external id to its corresponding internal id.
Source§fn to_external_id(
&self,
_context: &DefaultContext,
id: Self::InternalId,
) -> Result<Self::ExternalId, Self::Error>
fn to_external_id( &self, _context: &DefaultContext, id: Self::InternalId, ) -> Result<Self::ExternalId, Self::Error>
Translate an internal id its corresponding external id.
type Context = DefaultContext
type InternalId = u32
type ExternalId = u32
Source§type Guard = NoopGuard<u32>
type Guard = NoopGuard<u32>
The operation guard returned by
SetElement::set_element to notify self if an
operation fails. Read moretype Error = ANNError
Source§impl<'this, Data, ProviderFactory> DefaultPostProcessor<'this, DiskProvider<Data>, &'this [<Data as GraphDataType>::VectorDataType], (<DiskProvider<Data> as DataProvider>::InternalId, <Data as GraphDataType>::AssociatedDataType)> for DiskSearchStrategy<'this, Data, ProviderFactory>
impl<'this, Data, ProviderFactory> DefaultPostProcessor<'this, DiskProvider<Data>, &'this [<Data as GraphDataType>::VectorDataType], (<DiskProvider<Data> as DataProvider>::InternalId, <Data as GraphDataType>::AssociatedDataType)> for DiskSearchStrategy<'this, Data, ProviderFactory>
Source§type Processor = RerankAndFilter<'this>
type Processor = RerankAndFilter<'this>
The default post-processor type.
Source§fn default_post_processor(&'this self) -> Self::Processor
fn default_post_processor(&'this self) -> Self::Processor
Create the default post-processor.
Source§impl<Data> LoadWith<AsyncDiskLoadContext> for DiskProvider<Data>where
Data: GraphDataType<VectorIdType = u32>,
impl<Data> LoadWith<AsyncDiskLoadContext> for DiskProvider<Data>where
Data: GraphDataType<VectorIdType = u32>,
Source§async fn load_with<P>(
provider: &P,
ctx: &AsyncDiskLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
async fn load_with<P>(
provider: &P,
ctx: &AsyncDiskLoadContext,
) -> ANNResult<Self>where
P: StorageReadProvider,
Load
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<'this, Data, ProviderFactory> SearchStrategy<'this, DiskProvider<Data>, &'this [<Data as GraphDataType>::VectorDataType]> for DiskSearchStrategy<'this, Data, ProviderFactory>
impl<'this, Data, ProviderFactory> SearchStrategy<'this, DiskProvider<Data>, &'this [<Data as GraphDataType>::VectorDataType]> for DiskSearchStrategy<'this, Data, ProviderFactory>
Source§type SearchAccessor = DiskAccessor<'this, Data, <ProviderFactory as VertexProviderFactory<Data>>::VertexProviderType>
type SearchAccessor = DiskAccessor<'this, Data, <ProviderFactory as VertexProviderFactory<Data>>::VertexProviderType>
The concrete type of the accessor that is used to access
Self during the greedy
graph search. The query will be provided to the accessor exactly once during search
to construct the query computer.Source§type SearchAccessorError = ANNError
type SearchAccessorError = ANNError
An error that can occur when getting a search_accessor.
Source§fn search_accessor(
&'this self,
provider: &'this DiskProvider<Data>,
_context: &DefaultContext,
query: &'this [Data::VectorDataType],
) -> Result<Self::SearchAccessor, Self::SearchAccessorError>
fn search_accessor( &'this self, provider: &'this DiskProvider<Data>, _context: &DefaultContext, query: &'this [Data::VectorDataType], ) -> Result<Self::SearchAccessor, Self::SearchAccessorError>
Construct and return the search accessor.
Auto Trait Implementations§
impl<Data> Freeze for DiskProvider<Data>
impl<Data> RefUnwindSafe for DiskProvider<Data>
impl<Data> Send for DiskProvider<Data>
impl<Data> Sync for DiskProvider<Data>
impl<Data> Unpin for DiskProvider<Data>
impl<Data> UnsafeUnpin for DiskProvider<Data>
impl<Data> UnwindSafe for DiskProvider<Data>
Blanket Implementations§
impl<T> AsyncFriendly for T
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> 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