Xuanwo commented on code in PR #5906: URL: https://github.com/apache/opendal/pull/5906#discussion_r2020224549
########## core/src/layers/cache.rs: ########## @@ -0,0 +1,213 @@ +use std::sync::Arc; + +use crate::raw::*; +use crate::*; +use bytes::Bytes; +use foyer::{DirectFsDeviceOptions, Engine, HybridCache, HybridCacheBuilder}; +use serde::{Deserialize, Serialize}; + +pub struct CacheLayer { + cache: Arc<HybridCache<CacheKey, CacheValue>>, +} + +// TODO: rename to foyer layer and receive a HybridCacheBuilder as the parameter? +// TODO: expose foyer metrics here? +impl CacheLayer { + pub async fn new( + disk_cache_dir: &str, Review Comment: I'm open to have `FoyerLayer` to accept an `HybridCacheBuilder`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org