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

Method create_with_surrogates

nodedb-vector/src/mmap_segment/reader.rs:54–62  ·  view source on GitHub ↗

Create a new segment file with explicit surrogate IDs and open it.

(
        path: &Path,
        dim: usize,
        vectors: &[&[f32]],
        surrogate_ids: &[u64],
    )

Source from the content-addressed store, hash-verified

52
53 /// Create a new segment file with explicit surrogate IDs and open it.
54 pub fn create_with_surrogates(
55 path: &Path,
56 dim: usize,
57 vectors: &[&[f32]],
58 surrogate_ids: &[u64],
59 ) -> std::io::Result<Self> {
60 write_segment(path, dim, vectors, surrogate_ids)?;
61 Self::open_with_policy(path, VectorSegmentDropPolicy::default())
62 }
63
64 /// Create a new segment with an explicit drop policy.
65 pub fn create_with_policy(

Callers

nothing calls this directly

Calls 1

write_segmentFunction · 0.70

Tested by

no test coverage detected