diff --git a/crates/ecstore/src/store.rs b/crates/ecstore/src/store.rs index 1c0fd4a5c..7b3e09095 100644 --- a/crates/ecstore/src/store.rs +++ b/crates/ecstore/src/store.rs @@ -19,6 +19,7 @@ use crate::bucket::lifecycle::bucket_lifecycle_audit::LcEventSrc; use crate::bucket::lifecycle::bucket_lifecycle_ops::{ enqueue_immediate_expiry, enqueue_transition_immediate, init_background_expiry, }; +use crate::bucket::metadata_sys::get_global_bucket_metadata_sys; use crate::bucket::metadata_sys::{self, set_bucket_metadata}; use crate::bucket::utils::check_abort_multipart_args; use crate::bucket::utils::check_complete_multipart_args; @@ -33,6 +34,7 @@ use crate::bucket::utils::check_put_object_args; use crate::bucket::utils::check_put_object_part_args; use crate::bucket::utils::{check_valid_bucket_name, check_valid_bucket_name_strict, is_meta_bucketname}; use crate::config::storageclass; +use crate::config::{get_global_server_config, get_global_storage_class}; use crate::disk::endpoint::{Endpoint, EndpointType}; use crate::disk::{DiskAPI, DiskInfo, DiskInfoOptions}; use crate::error::{Error, Result}; @@ -44,7 +46,8 @@ use crate::event_notification::EventNotifier; use crate::global::{ DISK_ASSUME_UNKNOWN_SIZE, DISK_FILL_FRACTION, DISK_MIN_INODES, DISK_RESERVE_FRACTION, GLOBAL_BOOT_TIME, GLOBAL_LOCAL_DISK_MAP, GLOBAL_LOCAL_DISK_SET_DRIVES, TypeLocalDiskSetDrives, get_global_deployment_id, get_global_endpoints, - init_global_bucket_monitor, is_erasure_sd, set_global_deployment_id, set_object_layer, + get_global_region, get_global_tier_config_mgr, init_global_bucket_monitor, is_erasure_sd, set_global_deployment_id, + set_object_layer, }; use crate::notification_sys::get_global_notification_sys; use crate::pools::PoolMeta; @@ -231,6 +234,46 @@ impl ECStore { } } +/// Phase 3: Accessor methods for service globals +/// These provide a unified API through ECStore for accessing cross-cutting +/// service singletons. The globals remain the source of truth. +impl ECStore { + /// Get the notification system + pub fn notification_system(&self) -> Option<&'static crate::notification_sys::NotificationSys> { + get_global_notification_sys() + } + + /// Get the bucket metadata system + pub fn bucket_metadata_sys(&self) -> Option>> { + get_global_bucket_metadata_sys() + } + + /// Get the global endpoints + pub fn endpoints(&self) -> EndpointServerPools { + get_global_endpoints() + } + + /// Get the global region + pub fn region(&self) -> Option { + get_global_region() + } + + /// Get the tier config manager + pub fn tier_config_mgr(&self) -> Arc> { + get_global_tier_config_mgr() + } + + /// Get the server configuration + pub fn server_config(&self) -> Option { + get_global_server_config() + } + + /// Get the storage class configuration + pub fn storage_class(&self) -> Option { + get_global_storage_class() + } +} + // impl Clone for ECStore { // fn clone(&self) -> Self { // let pool_meta = match self.pool_meta.read() {