feat: sanitize mito config

This commit is contained in:
evenyag
2025-03-09 21:05:21 +08:00
parent 8c538622e2
commit 7183a93e5a
2 changed files with 9 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ const INDEX_CREATE_MEM_THRESHOLD_FACTOR: u64 = 16;
pub(crate) const FETCH_OPTION_TIMEOUT: Duration = Duration::from_secs(3);
/// Configuration for [MitoEngine](crate::engine::MitoEngine).
/// Before using the config, make sure to call `MitoConfig::validate()` to check if the config is valid.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[serde(default)]
pub struct MitoConfig {

View File

@@ -163,11 +163,16 @@ impl SstConverterBuilder {
}
/// Builds a SST converter.
pub async fn build(self) -> Result<SstConverter> {
pub async fn build(mut self) -> Result<SstConverter> {
self.config
.sanitize(&self.storage_config.data_home)
.context(MitoSnafu)?;
common_telemetry::info!(
"Building SST converter, input_path: {}, storage_config: {:?}",
"Building SST converter, input_path: {}, storage_config: {:?}, config: {:?}",
self.input_path,
self.storage_config
self.storage_config,
self.config
);
let input_store = new_input_store(&self.input_path).await?;