MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / init

Method init

graphlite/src/catalog/providers/graph_metadata.rs:683–715  ·  view source on GitHub ↗
(&mut self, storage: Arc<StorageManager>)

Source from the content-addressed store, hash-verified

681
682impl 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 {

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.80
load_catalog_providerMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected