Get all graph names from cache and storage tiers
(&self)
| 261 | |
| 262 | /// Get all graph names from cache and storage tiers |
| 263 | pub fn get_graph_names(&self) -> Result<Vec<String>, StorageError> { |
| 264 | debug!("Getting all graph names from storage manager"); |
| 265 | |
| 266 | // Get names from cache |
| 267 | let mut names = self.cache.get_graph_names()?; |
| 268 | |
| 269 | // Get names from persistent storage and merge |
| 270 | if let Some(persistent_store) = &self.persistent_store { |
| 271 | if let Some(driver) = &self.storage_driver { |
| 272 | if let Ok(persistent_names) = persistent_store.list_graphs(driver.as_ref().as_ref()) |
| 273 | { |
| 274 | for name in persistent_names { |
| 275 | if !names.contains(&name) { |
| 276 | names.push(name); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // Get names from memory store and merge |
| 284 | if let Some(memory_store) = &self.memory_store { |
| 285 | if let Some(driver) = &self.storage_driver { |
| 286 | if let Ok(memory_names) = memory_store.list_graphs(driver.as_ref().as_ref()) { |
| 287 | for name in memory_names { |
| 288 | if !names.contains(&name) { |
| 289 | names.push(name); |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | names.sort(); |
| 297 | debug!("Found {} graphs in storage manager", names.len()); |
| 298 | Ok(names) |
| 299 | } |
| 300 | |
| 301 | /// Delete a graph from all storage tiers |
| 302 | pub fn delete_graph(&self, name: &str) -> Result<(), StorageError> { |
no test coverage detected