(
&mut self,
vectors: Vec<[f32; VECTOR_SIZE]>,
kvs: Vec<Vec<KVPair>>,
)
| 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, |