feat: use cache in compaction (#3982)

This commit is contained in:
Yingwen
2024-05-20 10:36:51 +08:00
committed by GitHub
parent 7da92eb9eb
commit df13832a59

View File

@@ -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<CacheManagerRef>,
inputs: &[FileHandle],
append_mode: bool,
filter_deleted: bool,
) -> error::Result<BoxedBatchReader> {
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.