refactor: consolidate ecstore public facade (#3678)

* refactor: expand ecstore compatibility facade

* test: enforce ecstore api facade imports

* refactor: hide legacy ecstore layout modules

* refactor: hide ecstore facade root modules
This commit is contained in:
安正超
2026-06-21 09:09:11 +08:00
committed by GitHub
parent 77e005ee98
commit 0985225448
32 changed files with 498 additions and 252 deletions
+9 -9
View File
@@ -60,17 +60,17 @@ impl RuntimeDriveHealthState {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DriveRecoveryClass {
ShortOffline,
MediumOffline,
LongOffline,
Short,
Medium,
Long,
}
impl DriveRecoveryClass {
pub fn as_str(self) -> &'static str {
match self {
Self::ShortOffline => "short_offline",
Self::MediumOffline => "medium_offline",
Self::LongOffline => "long_offline",
Self::Short => "short_offline",
Self::Medium => "medium_offline",
Self::Long => "long_offline",
}
}
}
@@ -112,11 +112,11 @@ pub fn get_drive_long_offline_threshold() -> Duration {
pub fn classify_drive_recovery(duration: Duration) -> DriveRecoveryClass {
if duration <= get_drive_offline_grace_period() {
DriveRecoveryClass::ShortOffline
DriveRecoveryClass::Short
} else if duration >= get_drive_long_offline_threshold() {
DriveRecoveryClass::LongOffline
DriveRecoveryClass::Long
} else {
DriveRecoveryClass::MediumOffline
DriveRecoveryClass::Medium
}
}