From 06eb9ef6059681fe81c25f0a0807c157682824e1 Mon Sep 17 00:00:00 2001 From: evenyag Date: Sat, 18 May 2024 14:39:52 +0800 Subject: [PATCH] feat: use cache in compaction --- src/mito2/src/compaction/twcs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mito2/src/compaction/twcs.rs b/src/mito2/src/compaction/twcs.rs index c1e9414301c2..11aef62295ac 100644 --- a/src/mito2/src/compaction/twcs.rs +++ b/src/mito2/src/compaction/twcs.rs @@ -440,6 +440,7 @@ impl TwcsCompactionTask { let reader = build_sst_reader( metadata.clone(), sst_layer.clone(), + Some(cache_manager.clone()), &output.inputs, append_mode, output.filter_deleted, @@ -700,12 +701,14 @@ pub(crate) struct CompactionOutput { async fn build_sst_reader( metadata: RegionMetadataRef, sst_layer: AccessLayerRef, + cache: Option, inputs: &[FileHandle], append_mode: bool, filter_deleted: bool, ) -> error::Result { let scan_input = ScanInput::new(sst_layer, ProjectionMapper::all(&metadata)?) .with_files(inputs.to_vec()) + .with_cache(cache) .with_append_mode(append_mode) .with_filter_deleted(filter_deleted) // We ignore file not found error during compaction.