diff --git a/src/object-store/src/layers/lru_cache.rs b/src/object-store/src/layers/lru_cache.rs index f43468dcf2ef..c0958638b90d 100644 --- a/src/object-store/src/layers/lru_cache.rs +++ b/src/object-store/src/layers/lru_cache.rs @@ -62,7 +62,7 @@ impl Layer for LruCacheLayer { fn layer(&self, inner: I) -> Self::LayeredAccessor { LruCacheAccessor { - inner: Arc::new(inner), + inner, read_cache: self.read_cache.clone(), } } @@ -70,7 +70,7 @@ impl Layer for LruCacheLayer { #[derive(Debug)] pub struct LruCacheAccessor { - inner: Arc, + inner: I, read_cache: ReadCache, } diff --git a/src/object-store/src/layers/lru_cache/read_cache.rs b/src/object-store/src/layers/lru_cache/read_cache.rs index ca0252224039..586465b996ac 100644 --- a/src/object-store/src/layers/lru_cache/read_cache.rs +++ b/src/object-store/src/layers/lru_cache/read_cache.rs @@ -172,7 +172,7 @@ impl ReadCache { /// and cache the result locally. pub(crate) async fn read( &self, - inner: &Arc, + inner: &I, path: &str, args: OpRead, ) -> Result<(RpRead, Box)> @@ -223,7 +223,7 @@ impl ReadCache { /// Read the file from remote storage. If success, write the content into local cache. async fn read_remote( &self, - inner: &Arc, + inner: &I, read_key: &str, path: &str, args: OpRead,