From df13832a5937b6b187e597e92f6f858522da39c1 Mon Sep 17 00:00:00 2001 From: Yingwen Date: Mon, 20 May 2024 10:36:51 +0800 Subject: [PATCH] feat: use cache in compaction (#3982) --- 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.