Skip to content

Commit 9b87cd7

Browse files
authored
refactor: move last cache to influxdb3_cache crate (influxdata#25620)
Moved all of the last cache implementation into the `influxdb3_cache` crate. This also splits out the implementation into three modules: - `cache.rs`: the core cache implementation - `provider.rs`: the cache provider used by the database to hold multiple caches. - `table_function.rs`: same as before, holds the DataFusion impls Tests were preserved and moved to `mod.rs`, however, they were updated to not rely on the WriteBuffer implementation, and instead use the types in the `influxdb3_cache::last_cache` module directly. This simplified the test code, while not changing any of the test assertions at all.
1 parent 7211e8a commit 9b87cd7

File tree

22 files changed

+3248
-3534
lines changed

22 files changed

+3248
-3534
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

influxdb3/src/commands/serve.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use clap_blocks::{
88
tokio::TokioDatafusionConfig,
99
};
1010
use datafusion_util::config::register_iox_object_store;
11-
use influxdb3_cache::meta_cache::MetaCacheProvider;
11+
use influxdb3_cache::{
12+
last_cache::{self, LastCacheProvider},
13+
meta_cache::MetaCacheProvider,
14+
};
1215
use influxdb3_process::{
1316
build_malloc_conf, setup_metric_registry, INFLUXDB3_GIT_HASH, INFLUXDB3_VERSION, PROCESS_UUID,
1417
};
@@ -22,7 +25,6 @@ use influxdb3_sys_events::SysEventStore;
2225
use influxdb3_telemetry::store::TelemetryStore;
2326
use influxdb3_wal::{Gen1Duration, WalConfig};
2427
use influxdb3_write::{
25-
last_cache::LastCacheProvider,
2628
parquet_cache::create_cached_obj_store_and_oracle,
2729
persister::Persister,
2830
write_buffer::{persisted_files::PersistedFiles, WriteBufferImpl, WriteBufferImplArgs},
@@ -80,7 +82,7 @@ pub enum Error {
8082
InitializePersistedCatalog(#[source] influxdb3_write::persister::Error),
8183

8284
#[error("failed to initialize last cache: {0}")]
83-
InitializeLastCache(#[source] influxdb3_write::last_cache::Error),
85+
InitializeLastCache(#[source] last_cache::Error),
8486

8587
#[error("failed to initialize meta cache: {0:#}")]
8688
InitializeMetaCache(#[source] influxdb3_cache::meta_cache::ProviderError),

influxdb3_cache/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ license.workspace = true
88
[dependencies]
99
# Core Crates
1010
iox_time.workspace = true
11+
observability_deps.workspace = true
1112
schema.workspace = true
1213

1314
# Local deps
@@ -27,8 +28,18 @@ thiserror.workspace = true
2728
tokio.workspace = true
2829

2930
[dev-dependencies]
31+
# core deps
32+
arrow_util.workspace = true
33+
data_types.workspace = true
34+
3035
# Local deps
3136
influxdb3_write = { path = "../influxdb3_write" }
3237

38+
# crates.io deps
39+
bimap.workspace = true
40+
insta.workspace = true
41+
object_store.workspace = true
42+
test-log.workspace = true
43+
3344
[lints]
3445
workspace = true

0 commit comments

Comments
 (0)