refactor: narrow startup and ecstore root facades (#3679)

* refactor: narrow startup owner visibility

* refactor: prune remaining ecstore root facades
This commit is contained in:
安正超
2026-06-21 09:42:15 +08:00
committed by GitHub
parent 0985225448
commit d4150117c3
26 changed files with 213 additions and 109 deletions
@@ -33,7 +33,7 @@
//! ```
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use rustfs_ecstore::erasure_coding::Erasure;
use rustfs_ecstore::api::erasure::Erasure;
use std::hint::black_box;
use std::time::Duration;
+1 -1
View File
@@ -44,7 +44,7 @@
//! - SIMD optimization for different shard sizes
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use rustfs_ecstore::erasure_coding::{BitrotReader, BitrotWriter, Erasure, calc_shard_size};
use rustfs_ecstore::api::erasure::{BitrotReader, BitrotWriter, Erasure, calc_shard_size};
use rustfs_utils::HashAlgorithm;
use std::hint::black_box;
use std::io::Cursor;
@@ -13,7 +13,7 @@
// limitations under the License.
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use rustfs_ecstore::erasure_coding::{BitrotWriterWrapper, CustomWriter, Erasure};
use rustfs_ecstore::api::erasure::{BitrotWriterWrapper, CustomWriter, Erasure};
use rustfs_utils::HashAlgorithm;
use std::io::Cursor;
use std::sync::Arc;
+23
View File
@@ -18,6 +18,10 @@ pub mod admin {
pub use crate::admin_server_info::{get_local_server_property, get_server_info};
}
pub mod bitrot {
pub use crate::bitrot::{create_bitrot_reader, create_bitrot_writer};
}
pub mod bucket {
pub use crate::bucket::{
bandwidth, bucket_target_sys, lifecycle, metadata, metadata_sys, migration, object_lock, policy_sys, quota, replication,
@@ -78,7 +82,15 @@ pub mod error {
};
}
pub mod erasure {
pub use crate::erasure_coding::{
BitrotReader, BitrotWriter, BitrotWriterWrapper, CustomWriter, Erasure, ReedSolomonEncoder, calc_shard_size,
calc_shard_size_legacy,
};
}
pub mod event {
pub use crate::event::name::EventName;
pub use crate::event_notification::{EventArgs, register_event_dispatch_hook};
}
@@ -107,6 +119,13 @@ pub mod notification {
};
}
pub mod object {
pub use crate::object_api::{
BLOCK_SIZE_V2, ERASURE_ALGORITHM, GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader, RangedDecompressReader,
StreamConsumer,
};
}
pub mod rebalance {
pub use crate::rebalance::{
DiskStat, RebalSaveOpt, RebalStatus, RebalanceCleanupWarnings, RebalanceInfo, RebalanceMeta, RebalanceStats,
@@ -132,6 +151,10 @@ pub mod set_disk {
pub use crate::set_disk::{DEFAULT_READ_BUFFER_SIZE, SetDisks, get_lock_acquire_timeout, is_valid_storage_class};
}
pub mod store_list {
pub use crate::store_list_objects::{ListPathOptions, max_keys_plus_one};
}
pub mod storage {
pub use crate::store::{
ECStore, all_local_disk, all_local_disk_path, find_local_disk_by_ref, init_local_disks, init_lock_clients,
+1 -1
View File
@@ -368,7 +368,7 @@ fn recover_empty_payload_data_shards(
///
/// # Example
/// ```ignore
/// use rustfs_ecstore::erasure_coding::Erasure;
/// use rustfs_ecstore::api::erasure::Erasure;
/// let erasure = Erasure::new(4, 2, 8);
/// let data = b"hello world";
/// let shards = erasure.encode_data(data).unwrap();
+1 -1
View File
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Compatibility re-export for the legacy `rustfs_ecstore::event::name::EventName` path.
//! Compatibility re-export for the ECStore event facade.
//! The canonical event definition now lives in `rustfs_s3_types::EventName`.
pub use rustfs_s3_types::EventName;
+6 -6
View File
@@ -17,8 +17,8 @@ extern crate core;
mod admin_server_info;
pub mod api;
pub mod batch_processor;
pub mod bitrot;
mod batch_processor;
mod bitrot;
mod bucket;
mod cache_value;
mod compress;
@@ -28,13 +28,13 @@ mod data_usage;
mod disk;
mod disks_layout;
mod endpoints;
pub mod erasure_coding;
mod erasure_coding;
mod error;
mod global;
pub(crate) mod layout;
mod metrics_realtime;
mod notification_sys;
pub mod object_api;
mod object_api;
mod pools;
mod rebalance;
mod rio;
@@ -44,12 +44,12 @@ mod sets;
mod storage_api_contracts;
mod store;
mod store_init;
pub mod store_list_objects;
mod store_list_objects;
mod store_utils;
// pub mod checksum;
mod client;
pub mod event;
mod event;
mod event_notification;
#[cfg(test)]
mod pools_test;
@@ -13,8 +13,8 @@
// limitations under the License.
use rustfs_common::heal_channel::HealOpts;
use rustfs_ecstore::api::object::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
use rustfs_ecstore::api::{disk::DiskStore, error::Error, storage::ECStore};
use rustfs_ecstore::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
use rustfs_filemeta::FileInfo;
use rustfs_lock::NamespaceLockWrapper;
use rustfs_madmin::heal_commands::HealResultItem;
@@ -27,9 +27,9 @@
//!
//! For MinIO data: RUSTFS_LEGACY_TEST_ROOT=/path/to/minio (disk "test" and .minio.sys auto-detected).
use rustfs_ecstore::api::bitrot::create_bitrot_reader;
use rustfs_ecstore::api::disk::endpoint::Endpoint;
use rustfs_ecstore::api::disk::{DiskOption, STORAGE_FORMAT_FILE, new_disk};
use rustfs_ecstore::bitrot::create_bitrot_reader;
use rustfs_filemeta::{FileInfoOpts, get_file_info};
use rustfs_utils::HashAlgorithm;
use std::path::PathBuf;
@@ -4,11 +4,11 @@ use std::fs;
use std::io::Cursor;
use std::path::{Path, PathBuf};
use rustfs_ecstore::api::bitrot::create_bitrot_reader;
use rustfs_ecstore::api::disk::endpoint::Endpoint;
use rustfs_ecstore::api::disk::{DiskAPI as _, DiskOption, new_disk};
use rustfs_ecstore::bitrot::create_bitrot_reader;
use rustfs_ecstore::erasure_coding::Erasure;
use rustfs_ecstore::object_api::{GetObjectReader, ObjectInfo, ObjectOptions};
use rustfs_ecstore::api::erasure::Erasure;
use rustfs_ecstore::api::object::{GetObjectReader, ObjectInfo, ObjectOptions};
use rustfs_filemeta::{FileInfo, FileInfoOpts, get_file_info};
use serde::Deserialize;
use sha2::{Digest, Sha256};