refactor(storage): remove object cache plumbing (#2422)

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-04-07 22:00:53 +08:00
committed by GitHub
parent e3000f16e0
commit 79ffecbf14
22 changed files with 188 additions and 5011 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ pub use config::{ConcurrencyConfig, ConcurrencyFeatures};
// Manager
mod manager;
pub use manager::{ConcurrencyManager, GetObjectCacheEligibility, GetObjectQueueSnapshot};
pub use manager::{ConcurrencyManager, GetObjectQueueSnapshot};
// Prelude for convenient imports
pub mod prelude {
-46
View File
@@ -55,38 +55,6 @@ impl GetObjectQueueSnapshot {
}
}
/// Minimal cache writeback decision inputs for GetObject orchestration.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct GetObjectCacheEligibility {
/// Whether response caching is globally enabled.
pub cache_enabled: bool,
/// Whether the selected I/O strategy allows cache writeback.
pub cache_writeback_enabled: bool,
/// Whether the request is for a specific multipart part.
pub is_part_request: bool,
/// Whether the request is a range read.
pub is_range_request: bool,
/// Whether server-side or customer-provided encryption was applied.
pub encryption_applied: bool,
/// Response payload size in bytes.
pub response_size: i64,
/// Maximum cacheable object size in bytes.
pub max_cacheable_size: usize,
}
impl GetObjectCacheEligibility {
/// Return whether this GetObject response should be cached.
pub fn should_cache(&self) -> bool {
self.cache_enabled
&& self.cache_writeback_enabled
&& !self.is_part_request
&& !self.is_range_request
&& !self.encryption_applied
&& self.response_size > 0
&& (self.response_size as usize) <= self.max_cacheable_size
}
}
/// Main concurrency manager that provides access to all concurrency features
pub struct ConcurrencyManager {
config: ConcurrencyConfig,
@@ -320,20 +288,6 @@ mod tests {
assert!(snapshot.is_congested(70.0));
}
#[test]
fn test_cache_eligibility() {
let plan = GetObjectCacheEligibility {
cache_enabled: true,
cache_writeback_enabled: true,
is_part_request: false,
is_range_request: false,
encryption_applied: false,
response_size: 1024,
max_cacheable_size: 2048,
};
assert!(plan.should_cache());
}
#[test]
fn test_manager_creation() {
let manager = ConcurrencyManager::with_defaults();