diff --git a/analytic_engine/src/instance/mod.rs b/analytic_engine/src/instance/mod.rs index 7e45bd37fd..844319d660 100644 --- a/analytic_engine/src/instance/mod.rs +++ b/analytic_engine/src/instance/mod.rs @@ -147,8 +147,6 @@ pub struct Instance { pub(crate) db_write_buffer_size: usize, /// Space write buffer size pub(crate) space_write_buffer_size: usize, - /// The ratio of table's write buffer size to trigger preflush - pub(crate) preflush_write_buffer_size_ratio: f32, /// Replay wal batch size pub(crate) replay_batch_size: usize, /// Write sst max buffer size diff --git a/analytic_engine/src/instance/open.rs b/analytic_engine/src/instance/open.rs index c7f5291861..be413ac665 100644 --- a/analytic_engine/src/instance/open.rs +++ b/analytic_engine/src/instance/open.rs @@ -10,7 +10,7 @@ use std::{ use common_types::schema::IndexInWriterSchema; use log::{debug, error, info, trace}; use object_store::ObjectStoreRef; -use snafu::{OptionExt, ResultExt}; +use snafu::ResultExt; use table_engine::engine::OpenTableRequest; use wal::{ log_batch::LogEntry, @@ -23,9 +23,7 @@ use crate::{ engine, instance::{ self, - engine::{ - ApplyMemTable, FlushTable, OpenManifest, ReadMetaUpdate, ReadWal, Result, - }, + engine::{ApplyMemTable, FlushTable, OpenManifest, ReadMetaUpdate, ReadWal, Result}, flush_compaction::TableFlushOptions, mem_collector::MemUsageCollector, serial_executor::TableOpSerialExecutor, @@ -40,7 +38,7 @@ use crate::{ factory::{FactoryRef as SstFactoryRef, ObjectStorePickerRef, ScanOptions}, file::FilePurger, }, - table::data::{TableDataRef}, + table::data::TableDataRef, table_meta_set_impl::TableMetaSetImpl, }; @@ -124,7 +122,6 @@ impl Instance { mem_usage_collector: Arc::new(MemUsageCollector::default()), db_write_buffer_size: ctx.config.db_write_buffer_size, space_write_buffer_size: ctx.config.space_write_buffer_size, - preflush_write_buffer_size_ratio: ctx.config.preflush_write_buffer_size_ratio, replay_batch_size: ctx.config.replay_batch_size, write_sst_max_buffer_size: ctx.config.write_sst_max_buffer_size.as_byte() as usize, max_bytes_per_write_batch: ctx diff --git a/analytic_engine/src/manifest/details.rs b/analytic_engine/src/manifest/details.rs index 59feccfeff..3ede407ace 100644 --- a/analytic_engine/src/manifest/details.rs +++ b/analytic_engine/src/manifest/details.rs @@ -705,7 +705,8 @@ mod tests { meta_edit::{ AddTableMeta, AlterOptionsMeta, AlterSchemaMeta, DropTableMeta, MetaEdit, MetaUpdate, VersionEditMeta, - }, LoadRequest, Manifest, + }, + LoadRequest, Manifest, }, table::data::TableShardInfo, TableOptions, @@ -768,7 +769,7 @@ mod tests { match meta_edit { MetaEdit::Update(update) => { - builder.apply_update(update); + builder.apply_update(update).unwrap(); } MetaEdit::Snapshot(meta_snapshot) => { let MetaSnapshot { diff --git a/analytic_engine/src/manifest/mod.rs b/analytic_engine/src/manifest/mod.rs index 78783d3bcd..15a645fb99 100644 --- a/analytic_engine/src/manifest/mod.rs +++ b/analytic_engine/src/manifest/mod.rs @@ -13,10 +13,7 @@ use common_types::table::ShardId; use common_util::error::GenericResult; use table_engine::table::TableId; -use crate::{ - manifest::{meta_edit::MetaEditRequest}, - space::SpaceId, -}; +use crate::{manifest::meta_edit::MetaEditRequest, space::SpaceId}; #[derive(Debug)] pub struct LoadRequest { diff --git a/analytic_engine/src/table_meta_set_impl.rs b/analytic_engine/src/table_meta_set_impl.rs index b1bdba61e1..b680f56d3a 100644 --- a/analytic_engine/src/table_meta_set_impl.rs +++ b/analytic_engine/src/table_meta_set_impl.rs @@ -34,6 +34,7 @@ use crate::{ pub(crate) struct TableMetaSetImpl { pub(crate) spaces: SpacesRef, pub(crate) file_purger: FilePurgerRef, + // TODO: maybe not suitable to place this parameter here? pub(crate) preflush_write_buffer_size_ratio: f32, }