refactor: add region_dir in CompactionRegion (#4187)

This commit is contained in:
zyy17
2024-06-24 16:25:52 +08:00
committed by GitHub
parent 517917453d
commit ea7c17089f
2 changed files with 8 additions and 5 deletions

View File

@@ -276,6 +276,7 @@ impl CompactionScheduler {
let compaction_region = CompactionRegion {
region_id,
region_dir: access_layer.region_dir().to_string(),
current_version: current_version.clone(),
region_options: current_version.options.clone(),
engine_config: engine_config.clone(),

View File

@@ -54,6 +54,7 @@ use crate::sst::parquet::WriteOptions;
pub struct CompactionRegion {
pub region_id: RegionId,
pub region_options: RegionOptions,
pub region_dir: String,
pub(crate) engine_config: Arc<MitoConfig>,
pub(crate) region_metadata: RegionMetadataRef,
@@ -163,14 +164,15 @@ pub async fn open_compaction_region(
};
Ok(CompactionRegion {
region_options: region_options.clone(),
manifest_ctx,
access_layer,
current_version,
region_id: req.region_id,
cache_manager: Arc::new(CacheManager::default()),
region_options: region_options.clone(),
region_dir: req.region_dir.clone(),
engine_config: Arc::new(mito_config.clone()),
region_metadata: region_metadata.clone(),
cache_manager: Arc::new(CacheManager::default()),
access_layer,
manifest_ctx,
current_version,
})
}