refactor: clean scanner heal runtime boundaries (#3571)

This commit is contained in:
安正超
2026-06-18 16:12:27 +08:00
committed by GitHub
parent 51409c40ef
commit bdb2461b55
17 changed files with 150 additions and 117 deletions
+42 -4
View File
@@ -13,14 +13,48 @@
// limitations under the License.
use http::HeaderMap;
use rustfs_ecstore::{
error::Error,
pub(crate) use rustfs_ecstore::{
bucket::{
bucket_target_sys::BucketTargetSys,
lifecycle::{
bucket_lifecycle_audit::LcEventSrc,
bucket_lifecycle_ops::{GLOBAL_ExpiryState, apply_expiry_rule, apply_transition_rule},
evaluator::Evaluator,
lifecycle::{Event, Lifecycle, ObjectOpts, TRANSITION_COMPLETE},
},
metadata_sys::{get_lifecycle_config, get_object_lock_config, get_replication_config},
replication::{
ReplicationConfig, ReplicationConfigurationExt, ReplicationQueueAdmission, queue_replication_heal_internal,
},
versioning::VersioningApi,
versioning_sys::BucketVersioningSys,
},
cache_value::metacache_set::{ListPathRawOptions, list_path_raw},
config::{
com::{read_config, save_config},
storageclass,
},
data_usage::replace_bucket_usage_memory_from_info,
disk::{BUCKET_META_PREFIX, Disk, DiskAPI, DiskInfoOptions, RUSTFS_META_BUCKET, STORAGE_FORMAT_FILE, error::DiskError},
error::{Error as EcstoreError, Result as EcstoreResult, StorageError},
global::{GLOBAL_TierConfigMgr, is_erasure, is_erasure_sd},
pools::{path2_bucket_object, path2_bucket_object_with_base_path},
set_disk::SetDisks,
store::ECStore,
store_api::{
GetObjectReader as EcstoreGetObjectReader, ObjectInfo as EcstoreObjectInfo, ObjectOptions as EcstoreObjectOptions,
ObjectToDelete as EcstoreObjectToDelete, PutObjReader as EcstorePutObjReader,
},
store_utils::is_reserved_or_invalid_bucket,
};
use rustfs_storage_api::{HTTPRangeSpec, ObjectIO};
use std::sync::Arc;
#[cfg(test)]
pub(crate) use rustfs_ecstore::{
config::init as init_ecstore_config_for_scanner_tests,
disk::{DiskOption, endpoint::Endpoint, new_disk},
};
pub type ScannerGetObjectReader = EcstoreGetObjectReader;
pub type ScannerObjectInfo = EcstoreObjectInfo;
@@ -28,9 +62,13 @@ pub type ScannerObjectOptions = EcstoreObjectOptions;
pub type ScannerObjectToDelete = EcstoreObjectToDelete;
pub type ScannerPutObjReader = EcstorePutObjReader;
pub(crate) fn resolve_scanner_object_store_handle() -> Option<Arc<ECStore>> {
rustfs_ecstore::resolve_object_store_handle()
}
pub trait ScannerObjectIO:
ObjectIO<
Error = Error,
Error = EcstoreError,
RangeSpec = HTTPRangeSpec,
HeaderMap = HeaderMap,
ObjectOptions = ScannerObjectOptions,
@@ -43,7 +81,7 @@ pub trait ScannerObjectIO:
impl<T> ScannerObjectIO for T where
T: ObjectIO<
Error = Error,
Error = EcstoreError,
RangeSpec = HTTPRangeSpec,
HeaderMap = HeaderMap,
ObjectOptions = ScannerObjectOptions,