pub trait NodeFetcher {
// Required methods
fn dim(&self) -> usize;
fn prefetch_batch(&mut self, indices: &[u32]);
fn fetch_fp32(&mut self, idx: u32) -> Option<Vec<f32>>;
}Expand description
Abstraction over FP32 vector storage for a Vamana index partition.
Two impls exist:
InMemoryFetcher— plainVec<Vec<f32>>, available on all targets.IoUringNodeFetcher— Data Plane only, lives innodedb::data.
Required Methods§
Sourcefn prefetch_batch(&mut self, indices: &[u32])
fn prefetch_batch(&mut self, indices: &[u32])
Submit pre-fetch hints for indices so their data is ready before
fetch_fp32 is called.
On the in-memory path this is a no-op. On the io_uring path this
issues IORING_OP_READ SQEs without blocking — completion is polled
lazily inside fetch_fp32.
Sourcefn fetch_fp32(&mut self, idx: u32) -> Option<Vec<f32>>
fn fetch_fp32(&mut self, idx: u32) -> Option<Vec<f32>>
Retrieve the full-precision FP32 vector for node idx.
On the in-memory path this copies from a slice. On the io_uring path this collects the pre-fetched completion or falls back to a synchronous read if the pre-fetch was not issued.
Returns None if idx is out of range.