From 184c3b9d331095d2ffac759243bfa5421f043563 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Tue, 9 Jan 2024 07:06:22 +0000 Subject: [PATCH] feat: distinguish intermediate store and index store Signed-off-by: Zhenchi --- src/mito2/src/sst/index/creator.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mito2/src/sst/index/creator.rs b/src/mito2/src/sst/index/creator.rs index 87c3633b096b..5dc79591f139 100644 --- a/src/mito2/src/sst/index/creator.rs +++ b/src/mito2/src/sst/index/creator.rs @@ -84,12 +84,11 @@ impl SstIndexCreator { region_dir: String, sst_file_id: FileId, metadata: &RegionMetadataRef, - object_store: ObjectStore, + index_store: ObjectStore, + intermediate_store: ObjectStore, // prefer to use local store memory_usage_threshold: Option, row_group_size: NonZeroUsize, ) -> Self { - let store = InstrumentedStore::new(object_store); - // `memory_usage_threshold` is the total memory usage threshold of the index creation, // so we need to divide it by the number of columns let memory_threshold = memory_usage_threshold.map(|threshold| { @@ -97,7 +96,7 @@ impl SstIndexCreator { }); let temp_file_provider = Arc::new(TempFileProvider::new( IntermediateLocation::new(®ion_dir, &sst_file_id), - store.clone(), + InstrumentedStore::new(intermediate_store), )); let sorter = ExternalSorter::factory(temp_file_provider.clone() as _, memory_threshold); let index_creator = Box::new(SortIndexCreator::new(sorter, row_group_size)); @@ -106,7 +105,7 @@ impl SstIndexCreator { Self { region_dir, sst_file_id, - store, + store: InstrumentedStore::new(index_store), codec, index_creator, temp_file_provider,