MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / add_to_wal

Method add_to_wal

src/services/commit.rs:260–279  ·  view source on GitHub ↗
(
        &mut self,
        vectors: Vec<[f32; VECTOR_SIZE]>,
        kvs: Vec<Vec<KVPair>>,
    )

Source from the content-addressed store, hash-verified

258 }
259
260 pub fn add_to_wal(
261 &mut self,
262 vectors: Vec<[f32; VECTOR_SIZE]>,
263 kvs: Vec<Vec<KVPair>>,
264 ) -> io::Result<()> {
265 if vectors.len() != vectors.len() {
266 return Err(io::Error::new(
267 io::ErrorKind::InvalidInput,
268 "Quantized vectors length mismatch",
269 ));
270 }
271
272 // self.state.wal.commit(hash, quantized_vectors, kvs)
273 self.state
274 .wal
275 .add_to_wal(vectors, kvs)
276 .expect("Failed to add to wal");
277
278 Ok(())
279 }
280
281 pub fn batch_add_to_wal(
282 &mut self,

Callers

nothing calls this directly

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected