Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cache eviction #610

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mountpoint-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ serde = { version = "1.0.190", features = ["derive"] }
bincode = "1.3.3"
sha2 = "0.10.6"
hex = "0.4.3"
linked-hash-map = "0.5.6"
fs2 = "0.4.3"

[target.'cfg(target_os = "linux")'.dependencies]
procfs = { version = "0.15.1", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion mountpoint-s3/src/data_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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::disk_data_cache::{CacheLimit, DiskDataCache};
pub use crate::data_cache::in_memory_data_cache::InMemoryDataCache;

/// Struct representing a key for accessing an entry in a [DataCache].
Expand All @@ -31,6 +31,8 @@ pub enum DataCacheError {
IoFailure(#[from] std::io::Error),
#[error("Block content was not valid/readable")]
InvalidBlockContent,
#[error("Error while trying to evict cache content")]
EvictionFailure,
}

pub type DataCacheResult<Value> = Result<Value, DataCacheError>;
Expand Down
Loading