Skip to main content

NodeFetcher

Trait NodeFetcher 

Source
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 — plain Vec<Vec<f32>>, available on all targets.
  • IoUringNodeFetcher — Data Plane only, lives in nodedb::data.

Required Methods§

Source

fn dim(&self) -> usize

Vector dimensionality.

Source

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.

Source

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.

Implementors§