diff --git a/src/mito2/src/cache/write_cache.rs b/src/mito2/src/cache/write_cache.rs index 8a431f22a63d..fc9972de5305 100644 --- a/src/mito2/src/cache/write_cache.rs +++ b/src/mito2/src/cache/write_cache.rs @@ -20,7 +20,6 @@ use std::time::Duration; use common_base::readable_size::ReadableSize; use common_telemetry::{debug, info}; use futures::AsyncWriteExt; -use object_store::manager::ObjectStoreManagerRef; use object_store::ObjectStore; use snafu::ResultExt; @@ -44,10 +43,6 @@ use crate::sst::{DEFAULT_WRITE_BUFFER_SIZE, DEFAULT_WRITE_CONCURRENCY}; pub struct WriteCache { /// Local file cache. file_cache: FileCacheRef, - /// Object store manager. - #[allow(unused)] - /// TODO: Remove unused after implementing async write cache - object_store_manager: ObjectStoreManagerRef, /// Puffin manager factory for index. puffin_manager_factory: PuffinManagerFactory, /// Intermediate manager for index. @@ -61,7 +56,6 @@ impl WriteCache { /// `object_store_manager` for all object stores. pub async fn new( local_store: ObjectStore, - object_store_manager: ObjectStoreManagerRef, cache_capacity: ReadableSize, ttl: Option, puffin_manager_factory: PuffinManagerFactory, @@ -72,7 +66,6 @@ impl WriteCache { Ok(Self { file_cache, - object_store_manager, puffin_manager_factory, intermediate_manager, }) @@ -81,7 +74,6 @@ impl WriteCache { /// Creates a write cache based on local fs. pub async fn new_fs( cache_dir: &str, - object_store_manager: ObjectStoreManagerRef, cache_capacity: ReadableSize, ttl: Option, puffin_manager_factory: PuffinManagerFactory, @@ -92,7 +84,6 @@ impl WriteCache { let local_store = new_fs_cache_store(cache_dir).await?; Self::new( local_store, - object_store_manager, cache_capacity, ttl, puffin_manager_factory, diff --git a/src/mito2/src/test_util.rs b/src/mito2/src/test_util.rs index 314e886ba9ca..14b4bb4a9109 100644 --- a/src/mito2/src/test_util.rs +++ b/src/mito2/src/test_util.rs @@ -644,16 +644,9 @@ impl TestEnv { .unwrap(); let object_store_manager = self.get_object_store_manager().unwrap(); - let write_cache = WriteCache::new( - local_store, - object_store_manager, - capacity, - None, - puffin_mgr, - intm_mgr, - ) - .await - .unwrap(); + let write_cache = WriteCache::new(local_store, capacity, None, puffin_mgr, intm_mgr) + .await + .unwrap(); Arc::new(write_cache) } diff --git a/src/mito2/src/worker.rs b/src/mito2/src/worker.rs index 233ab9f056b1..62ad59f0701a 100644 --- a/src/mito2/src/worker.rs +++ b/src/mito2/src/worker.rs @@ -157,7 +157,6 @@ impl WorkerGroup { let purge_scheduler = Arc::new(LocalScheduler::new(config.max_background_purges)); let write_cache = write_cache_from_config( &config, - object_store_manager.clone(), puffin_manager_factory.clone(), intermediate_manager.clone(), ) @@ -303,7 +302,6 @@ impl WorkerGroup { .with_buffer_size(Some(config.index.write_buffer_size.as_bytes() as _)); let write_cache = write_cache_from_config( &config, - object_store_manager.clone(), puffin_manager_factory.clone(), intermediate_manager.clone(), ) @@ -364,7 +362,6 @@ fn region_id_to_index(id: RegionId, num_workers: usize) -> usize { async fn write_cache_from_config( config: &MitoConfig, - object_store_manager: ObjectStoreManagerRef, puffin_manager_factory: PuffinManagerFactory, intermediate_manager: IntermediateManager, ) -> Result> { @@ -383,7 +380,6 @@ async fn write_cache_from_config( let cache = WriteCache::new_fs( &config.experimental_write_cache_path, - object_store_manager, config.experimental_write_cache_size, config.experimental_write_cache_ttl, puffin_manager_factory,