From 6bdd76f1fcdeeaa0f6ecafd30f91b8cfedf337fa Mon Sep 17 00:00:00 2001 From: Alessandro Passaro Date: Thu, 5 Oct 2023 07:47:26 +0000 Subject: [PATCH] Expose DataCache module and CacheKey fields Signed-off-by: Alessandro Passaro --- mountpoint-s3/src/data_cache.rs | 10 ++++++---- mountpoint-s3/src/lib.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mountpoint-s3/src/data_cache.rs b/mountpoint-s3/src/data_cache.rs index 0c3f4f92d..12e68ba60 100644 --- a/mountpoint-s3/src/data_cache.rs +++ b/mountpoint-s3/src/data_cache.rs @@ -4,8 +4,8 @@ //! reducing both the number of requests as well as the latency for the reads. //! Ultimately, this means reduced cost in terms of S3 billing as well as compute time. -pub mod disk_data_cache; -pub mod in_memory_data_cache; +mod disk_data_cache; +mod in_memory_data_cache; use std::ops::RangeBounds; @@ -13,12 +13,14 @@ use mountpoint_s3_client::types::ETag; use thiserror::Error; pub use crate::checksums::ChecksummedBytes; +pub use crate::data_cache::disk_data_cache::DiskDataCache; +pub use crate::data_cache::in_memory_data_cache::InMemoryDataCache; /// Struct representing a key for accessing an entry in a [DataCache]. #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub struct CacheKey { - s3_key: String, - etag: ETag, + pub s3_key: String, + pub etag: ETag, } /// Indexes blocks within a given object. diff --git a/mountpoint-s3/src/lib.rs b/mountpoint-s3/src/lib.rs index a17cb14b3..21ca0fe3c 100644 --- a/mountpoint-s3/src/lib.rs +++ b/mountpoint-s3/src/lib.rs @@ -1,5 +1,5 @@ mod checksums; -mod data_cache; +pub mod data_cache; pub mod fs; pub mod fuse; mod inode;