refactor: prune trait import compat re-exports (#3699)

This commit is contained in:
安正超
2026-06-21 23:17:58 +08:00
committed by GitHub
parent f35821f75d
commit 6b3d96fde3
29 changed files with 272 additions and 137 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ use crate::heal::{
use crate::{Error, Result};
use metrics::{counter, gauge};
use rustfs_common::heal_channel::{HealAdmissionDropReason, HealAdmissionResult, HealRequestSource};
use rustfs_ecstore::api::disk::DiskAPI as _;
use rustfs_madmin::heal_commands::HealResultItem;
use std::{
collections::{BinaryHeap, HashMap},
@@ -33,7 +34,7 @@ use tokio::{
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, warn};
use super::storage_compat::{DiskAPI, DiskError, GLOBAL_LOCAL_DISK_MAP};
use super::storage_compat::{DiskError, GLOBAL_LOCAL_DISK_MAP};
const KEEP_HEAL_TASK_STATUS_DURATION: Duration = Duration::from_secs(10 * 60);
const LOG_COMPONENT_HEAL: &str = "heal";
+2 -1
View File
@@ -13,6 +13,7 @@
// limitations under the License.
use crate::{Error, Result};
use rustfs_ecstore::api::disk::DiskAPI as _;
use serde::{Deserialize, Serialize};
use std::path::Path;
use std::sync::Arc;
@@ -21,7 +22,7 @@ use tokio::sync::RwLock;
use tracing::{debug, warn};
use uuid::Uuid;
use super::storage_compat::{BUCKET_META_PREFIX, DiskAPI, DiskError, DiskStore, RUSTFS_META_BUCKET};
use super::storage_compat::{BUCKET_META_PREFIX, DiskError, DiskStore, RUSTFS_META_BUCKET};
const LOG_COMPONENT_HEAL: &str = "heal";
const LOG_SUBSYSTEM_RESUME: &str = "resume";
+10 -2
View File
@@ -22,9 +22,17 @@ pub(crate) type ECStore = rustfs_ecstore::api::storage::ECStore;
pub(crate) type EcstoreError = rustfs_ecstore::api::error::Error;
pub(crate) type Endpoint = rustfs_ecstore::api::disk::endpoint::Endpoint;
pub(crate) type StorageError = rustfs_ecstore::api::error::StorageError;
pub(crate) type LocalDiskMap = std::collections::HashMap<String, Option<DiskStore>>;
pub(crate) use rustfs_ecstore::api::disk::DiskAPI;
pub(crate) use rustfs_ecstore::api::global::GLOBAL_LOCAL_DISK_MAP;
pub(crate) struct GlobalLocalDiskMap;
pub(crate) static GLOBAL_LOCAL_DISK_MAP: GlobalLocalDiskMap = GlobalLocalDiskMap;
impl GlobalLocalDiskMap {
pub(crate) async fn read(&self) -> tokio::sync::RwLockReadGuard<'static, LocalDiskMap> {
rustfs_ecstore::api::global::GLOBAL_LOCAL_DISK_MAP.read().await
}
}
#[cfg(test)]
pub(crate) type DiskOption = rustfs_ecstore::api::disk::DiskOption;