(
&mut self,
hash: u64,
vectors: Vec<[u8; QUANTIZED_VECTOR_SIZE]>,
kvs: Vec<Vec<KVPair>>,
)
| 193 | } |
| 194 | |
| 195 | pub fn add_to_commit_list( |
| 196 | &mut self, |
| 197 | hash: u64, |
| 198 | vectors: Vec<[u8; QUANTIZED_VECTOR_SIZE]>, |
| 199 | kvs: Vec<Vec<KVPair>>, |
| 200 | ) -> Result<(), io::Error> { |
| 201 | let timestamp = SystemTime::now() |
| 202 | .duration_since(UNIX_EPOCH) |
| 203 | .unwrap() |
| 204 | .as_secs(); |
| 205 | |
| 206 | let commit_list_item = CommitListItem { |
| 207 | hash, |
| 208 | timestamp, |
| 209 | vectors, |
| 210 | kvs, |
| 211 | }; |
| 212 | |
| 213 | self.commit_list.insert(hash, commit_list_item)?; |
| 214 | |
| 215 | // self.commit_finish.insert(hash, false)?; |
| 216 | |
| 217 | // self.timestamps.insert(timestamp, hash)?; |
| 218 | |
| 219 | Ok(()) |
| 220 | } |
| 221 | |
| 222 | pub fn has_been_committed(&mut self, hash: u64) -> Result<bool, io::Error> { |
| 223 | match self.commit_list.has_key(hash) { |
no test coverage detected