MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_vectors_file

Function write_vectors_file

nodedb/src/data/vamana_fetcher.rs:307–315  ·  view source on GitHub ↗

Write a minimal Vamana vectors block (no adjacency, no header) to a temp file and verify that `IoUringNodeFetcher` reads it correctly.

(path: &std::path::Path, vectors: &[Vec<f32>])

Source from the content-addressed store, hash-verified

305 /// Write a minimal Vamana vectors block (no adjacency, no header) to a
306 /// temp file and verify that `IoUringNodeFetcher` reads it correctly.
307 fn write_vectors_file(path: &std::path::Path, vectors: &[Vec<f32>]) {
308 let mut f = std::fs::File::create(path).unwrap();
309 for vec in vectors {
310 for &x in vec {
311 f.write_all(&x.to_le_bytes()).unwrap();
312 }
313 }
314 f.sync_all().unwrap();
315 }
316
317 #[test]
318 fn fetch_single_node_no_prefetch() {

Callers 3

Calls 1

createFunction · 0.50

Tested by 3