Skip to content

Commit

Permalink
refactor: remove unused field in WriteCache
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Dec 24, 2024
1 parent 68dd291 commit e5772ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
9 changes: 0 additions & 9 deletions src/mito2/src/cache/write_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand All @@ -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<Duration>,
puffin_manager_factory: PuffinManagerFactory,
Expand All @@ -72,7 +66,6 @@ impl WriteCache {

Ok(Self {
file_cache,
object_store_manager,
puffin_manager_factory,
intermediate_manager,
})
Expand All @@ -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<Duration>,
puffin_manager_factory: PuffinManagerFactory,
Expand All @@ -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,
Expand Down
13 changes: 3 additions & 10 deletions src/mito2/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 0 additions & 4 deletions src/mito2/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down Expand Up @@ -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(),
)
Expand Down Expand Up @@ -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<Option<WriteCacheRef>> {
Expand All @@ -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,
Expand Down

0 comments on commit e5772ad

Please sign in to comment.