Load the persisted ND-array catalog from redb into the shared in-memory handle.
(
config: &ServerConfig,
)
| 18 | |
| 19 | /// Load the persisted ND-array catalog from redb into the shared in-memory handle. |
| 20 | pub fn load_array_catalog( |
| 21 | config: &ServerConfig, |
| 22 | ) -> crate::control::array_catalog::ArrayCatalogHandle { |
| 23 | let array_catalog = ArrayCatalog::handle(); |
| 24 | let catalog_path = config.catalog_path(); |
| 25 | match crate::control::security::catalog::SystemCatalog::open(&catalog_path) { |
| 26 | Ok(catalog) => match catalog.load_all_arrays() { |
| 27 | Ok(entries) => { |
| 28 | let mut guard = array_catalog |
| 29 | .write() |
| 30 | .expect("array catalog lock poisoned at startup"); |
| 31 | for entry in entries { |
| 32 | if let Err(e) = guard.register(entry) { |
| 33 | tracing::warn!(error = %e, "failed to register array at startup"); |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | Err(e) => { |
| 38 | tracing::warn!(error = %e, "failed to load _system.arrays at startup"); |
| 39 | } |
| 40 | }, |
| 41 | Err(e) => { |
| 42 | tracing::warn!(error = %e, "could not open system catalog to load arrays"); |
| 43 | } |
| 44 | } |
| 45 | array_catalog |
| 46 | } |
| 47 | |
| 48 | /// Shared Arc resources passed to each Data Plane core at spawn time. |
| 49 | pub struct CoreSharedResources { |
no test coverage detected