(
&self,
name: &str,
probability: f32,
)
| 175 | } |
| 176 | |
| 177 | pub fn probabilistic_update( |
| 178 | &self, |
| 179 | name: &str, |
| 180 | probability: f32, |
| 181 | ) -> Result<bool, WaCustomError> { |
| 182 | let mut rng = rand::thread_rng(); |
| 183 | if rng.gen::<f32>() < probability { |
| 184 | self.update_collection_usage(name)?; |
| 185 | Ok(true) |
| 186 | } else { |
| 187 | Ok(false) |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | // Loads the dense vector index for a collection |
| 192 | fn load_dense_index(&self, name: &str) -> Result<Option<Arc<HNSWIndex>>, WaCustomError> { |
no test coverage detected