(&mut self, storage: Arc<StorageManager>)
| 681 | |
| 682 | impl CatalogProvider for GraphMetadataCatalog { |
| 683 | fn init(&mut self, storage: Arc<StorageManager>) -> CatalogResult<()> { |
| 684 | self.storage = Some(storage.clone()); |
| 685 | |
| 686 | // Try to load persisted state from storage (same pattern as SecurityCatalog) |
| 687 | match storage.load_catalog_provider("graph_metadata") { |
| 688 | Ok(Some(data)) => { |
| 689 | // Load persisted catalog state |
| 690 | match self.load(&data) { |
| 691 | Ok(_) => { |
| 692 | log::info!("Graph metadata catalog loaded from storage with {} graphs, {} graph types", |
| 693 | self.graphs.len(), self.graph_types.len()); |
| 694 | } |
| 695 | Err(e) => { |
| 696 | log::warn!("Failed to deserialize graph metadata catalog from storage: {}. Using defaults.", e); |
| 697 | } |
| 698 | } |
| 699 | } |
| 700 | Ok(None) => { |
| 701 | // This is expected on first run - no catalog data exists yet |
| 702 | log::debug!( |
| 703 | "No persisted graph metadata catalog found. Using default initialization." |
| 704 | ); |
| 705 | } |
| 706 | Err(e) => { |
| 707 | log::warn!( |
| 708 | "Error loading graph metadata catalog: {}. Using default initialization.", |
| 709 | e |
| 710 | ); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | Ok(()) |
| 715 | } |
| 716 | |
| 717 | fn execute(&mut self, op: CatalogOperation) -> CatalogResult<CatalogResponse> { |
| 718 | match op { |
nothing calls this directly
no test coverage detected