diff --git a/docs/architecture/ecstore-module-split-plan.md b/docs/architecture/ecstore-module-split-plan.md index 6331e69c7..cd21c1c5a 100644 --- a/docs/architecture/ecstore-module-split-plan.md +++ b/docs/architecture/ecstore-module-split-plan.md @@ -196,7 +196,7 @@ Required contracts before crate movement: metrics through obs-local snapshot DTOs in `crates/obs/src/metrics/storage_api.rs` instead of carrying the ECStore replication stats handle through collectors. -- `ReplicationPoolHandle` / `ReplicationStatsHandle`: RustFS app, admin, +- `StorageReplicationPoolHandle` / `StorageReplicationStatsHandle`: RustFS app, admin, startup, and workload-admission code use storage-owner wrapper types from `rustfs/src/storage/storage_api.rs` for pool activity, resync, queue counts, proxy stats, and site metrics snapshots. diff --git a/rustfs/src/app/context.rs b/rustfs/src/app/context.rs index bd2d9e1af..1d13a9c7f 100644 --- a/rustfs/src/app/context.rs +++ b/rustfs/src/app/context.rs @@ -157,12 +157,12 @@ pub fn resolve_bucket_monitor_handle() -> Option> { } /// Resolve replication pool handle using AppContext-first precedence. -pub fn resolve_replication_pool_handle() -> Option> { +pub(crate) fn resolve_replication_pool_handle() -> Option> { resolve_replication_pool_handle_with(get_global_app_context()) } /// Resolve replication statistics handle using AppContext-first precedence. -pub fn resolve_replication_stats_handle() -> Option> { +pub(crate) fn resolve_replication_stats_handle() -> Option> { resolve_replication_stats_handle_with(get_global_app_context()) } diff --git a/rustfs/src/app/context/global.rs b/rustfs/src/app/context/global.rs index 76c14a662..b5f334e4d 100644 --- a/rustfs/src/app/context/global.rs +++ b/rustfs/src/app/context/global.rs @@ -166,11 +166,11 @@ impl AppContext { self.bucket_monitor.clone() } - pub fn replication_pool(&self) -> Arc { + pub(crate) fn replication_pool(&self) -> Arc { self.replication_pool.clone() } - pub fn replication_stats(&self) -> Arc { + pub(crate) fn replication_stats(&self) -> Arc { self.replication_stats.clone() } diff --git a/rustfs/src/app/context/handles.rs b/rustfs/src/app/context/handles.rs index ecfdbe020..d2f95fa4b 100644 --- a/rustfs/src/app/context/handles.rs +++ b/rustfs/src/app/context/handles.rs @@ -452,11 +452,11 @@ pub fn default_bucket_monitor_interface() -> Arc { Arc::new(BucketMonitorHandle) } -pub fn default_replication_pool_interface() -> Arc { +pub(crate) fn default_replication_pool_interface() -> Arc { Arc::new(ReplicationPoolHandle) } -pub fn default_replication_stats_interface() -> Arc { +pub(crate) fn default_replication_stats_interface() -> Arc { Arc::new(ReplicationStatsHandle) } diff --git a/rustfs/src/app/context/interfaces.rs b/rustfs/src/app/context/interfaces.rs index f004d54b3..281b5c5dc 100644 --- a/rustfs/src/app/context/interfaces.rs +++ b/rustfs/src/app/context/interfaces.rs @@ -101,12 +101,12 @@ pub trait BucketMonitorInterface: Send + Sync { } /// Replication pool interface for admin resync integration. -pub trait ReplicationPoolInterface: Send + Sync { +pub(crate) trait ReplicationPoolInterface: Send + Sync { fn handle(&self) -> Option>; } /// Replication statistics interface for admin metrics integration. -pub trait ReplicationStatsInterface: Send + Sync { +pub(crate) trait ReplicationStatsInterface: Send + Sync { fn handle(&self) -> Option>; } diff --git a/rustfs/src/storage/storage_api.rs b/rustfs/src/storage/storage_api.rs index 5168e8c5a..b8b198beb 100644 --- a/rustfs/src/storage/storage_api.rs +++ b/rustfs/src/storage/storage_api.rs @@ -486,7 +486,7 @@ pub(crate) type DiskStore = ecstore_disk::DiskStore; pub(crate) type DisksLayout = ecstore_layout::DisksLayout; type EcstoreDynReplicationPool = ecstore_bucket::replication::DynReplicationPool; type EcstoreReplicationStats = ecstore_bucket::replication::ReplicationStats; -pub(crate) type DynReplicationPool = ReplicationPoolHandle; +pub(crate) type DynReplicationPool = StorageReplicationPoolHandle; pub(crate) type DynReader = ecstore_rio::DynReader; pub(crate) type ECStore = ecstore_storage::ECStore; pub(crate) type Endpoint = ecstore_disk::endpoint::Endpoint; @@ -514,7 +514,7 @@ pub(crate) type ReadMultipleReq = ecstore_disk::ReadMultipleReq; pub(crate) type ReadMultipleResp = ecstore_disk::ReadMultipleResp; pub(crate) type ReadOptions = ecstore_disk::ReadOptions; pub(crate) type RenameDataResp = ecstore_disk::RenameDataResp; -pub(crate) type ReplicationStats = ReplicationStatsHandle; +pub(crate) type ReplicationStats = StorageReplicationStatsHandle; pub(crate) type SetupType = ecstore_layout::SetupType; pub(crate) type StorageError = ecstore_error::StorageError; pub(crate) type TierConfigMgr = ecstore_tier::TierConfigMgr; @@ -535,11 +535,11 @@ pub(crate) type HardLimitReader = ecstore_rio::HardLimitReader; pub(crate) type NotificationSys = ecstore_notification::NotificationSys; #[derive(Debug, Clone)] -pub struct ReplicationPoolHandle { +pub(crate) struct StorageReplicationPoolHandle { inner: Arc, } -impl ReplicationPoolHandle { +impl StorageReplicationPoolHandle { fn new(inner: Arc) -> Arc { Arc::new(Self { inner }) } @@ -577,11 +577,11 @@ impl ReplicationPoolHandle { } #[derive(Debug, Clone)] -pub struct ReplicationStatsHandle { +pub(crate) struct StorageReplicationStatsHandle { inner: Arc, } -impl ReplicationStatsHandle { +impl StorageReplicationStatsHandle { #[cfg(test)] pub(crate) fn new() -> Self { Self { @@ -689,11 +689,11 @@ pub(crate) fn disk_endpoint(disk: &DiskStore) -> String { } pub(crate) fn get_global_replication_pool() -> Option> { - ecstore_bucket::replication::get_global_replication_pool().map(ReplicationPoolHandle::new) + ecstore_bucket::replication::get_global_replication_pool().map(StorageReplicationPoolHandle::new) } pub(crate) fn get_global_replication_stats() -> Option> { - ecstore_bucket::replication::get_global_replication_stats().map(ReplicationStatsHandle::from_ecstore) + ecstore_bucket::replication::get_global_replication_stats().map(StorageReplicationStatsHandle::from_ecstore) } pub(crate) fn get_global_boot_time() -> Option {