Skip to content

Commit

Permalink
feat(mito): Implement file cache (GreptimeTeam#3022)
Browse files Browse the repository at this point in the history
* feat: recover cache

* feat: moka features

* test: tests for file cache

* chore: suppress warninig

* fix: parse_inde_key consider suffix

* feat: update cache

* feat: expose cache file path

* feat: use cache_path in test
  • Loading branch information
evenyag authored Jan 3, 2024
1 parent 128d371 commit 2e686fe
Show file tree
Hide file tree
Showing 3 changed files with 413 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mito2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ index.workspace = true
lazy_static = "1.4"
log-store = { workspace = true, optional = true }
memcomparable = "0.2"
moka = { workspace = true, features = ["sync"] }
moka = { workspace = true, features = ["sync", "future"] }
num_cpus = "1.13"
object-store.workspace = true
parquet = { workspace = true, features = ["async"] }
Expand Down
5 changes: 5 additions & 0 deletions src/mito2/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//! Cache for the engine.
mod cache_size;
// TODO(yingwen): Remove this after the write cache is ready.
#[allow(unused)]
pub(crate) mod file_cache;
#[cfg(test)]
pub(crate) mod test_util;

Expand All @@ -38,6 +41,8 @@ const SST_META_TYPE: &str = "sst_meta";
const VECTOR_TYPE: &str = "vector";
// Metrics type key for pages.
const PAGE_TYPE: &str = "page";
// Metrics type key for files on the local store.
const FILE_TYPE: &str = "file";

/// Manages cached data for the engine.
pub struct CacheManager {
Expand Down
Loading

0 comments on commit 2e686fe

Please sign in to comment.