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
type Error = ANNError
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<DiskProvider<Data>, [<Data as GraphDataType>::VectorDataType], (<DiskProvider<Data> as DataProvider>::InternalId, <Data as GraphDataType>::AssociatedDataType)> for DiskSearchStrategy<'this, Data, ProviderFactory>
impl<'this, Data, ProviderFactory> SearchStrategy<DiskProvider<Data>, [<Data as GraphDataType>::VectorDataType], (<DiskProvider<Data> as DataProvider>::InternalId, <Data as GraphDataType>::AssociatedDataType)> for DiskSearchStrategy<'this, Data, ProviderFactory>
Source§type QueryComputer = DiskQueryComputer
type QueryComputer = DiskQueryComputer
The computer used by the associated accessor. Read more
Source§type SearchAccessor<'a> = DiskAccessor<'a, Data, <ProviderFactory as VertexProviderFactory<Data>>::VertexProviderType>
type SearchAccessor<'a> = DiskAccessor<'a, 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§type PostProcessor = RerankAndFilter<'this>
type PostProcessor = RerankAndFilter<'this>
The associated
SearchPostProcessor for the final results.Source§fn search_accessor<'a>(
&'a self,
provider: &'a DiskProvider<Data>,
_context: &DefaultContext,
) -> Result<Self::SearchAccessor<'a>, Self::SearchAccessorError>
fn search_accessor<'a>( &'a self, provider: &'a DiskProvider<Data>, _context: &DefaultContext, ) -> Result<Self::SearchAccessor<'a>, Self::SearchAccessorError>
Construct and return the search accessor.
Source§fn post_processor(&self) -> Self::PostProcessor
fn post_processor(&self) -> Self::PostProcessor
Construct the
SearchPostProcess struct to post-process the results of search and
store them into the output container.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§
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