refactor: remove unnecessary args (#6493)

* x

Signed-off-by: luofucong <luofc@foxmail.com>

* refactor: remove unnecessary args

Signed-off-by: luofucong <luofc@foxmail.com>

---------

Signed-off-by: luofucong <luofc@foxmail.com>
This commit is contained in:
LFC
2025-07-09 21:23:15 +08:00
committed by GitHub
parent d99cd98c01
commit 2f765c8fd4
3 changed files with 12 additions and 7 deletions

View File

@@ -340,12 +340,12 @@ impl StartCommand {
.await
.context(StartMetaServerSnafu)?;
let builder = meta_srv::bootstrap::metasrv_builder(&opts, plugins.clone(), None)
let builder = meta_srv::bootstrap::metasrv_builder(&opts, plugins, None)
.await
.context(error::BuildMetaServerSnafu)?;
let metasrv = builder.build().await.context(error::BuildMetaServerSnafu)?;
let instance = MetasrvInstance::new(opts, plugins, metasrv)
let instance = MetasrvInstance::new(metasrv)
.await
.context(error::BuildMetaServerSnafu)?;

View File

@@ -95,11 +95,10 @@ pub struct MetasrvInstance {
}
impl MetasrvInstance {
pub async fn new(
opts: MetasrvOptions,
plugins: Plugins,
metasrv: Metasrv,
) -> Result<MetasrvInstance> {
pub async fn new(metasrv: Metasrv) -> Result<MetasrvInstance> {
let opts = metasrv.options().clone();
let plugins = metasrv.plugins().clone();
let builder = HttpServerBuilder::new(opts.http.clone())
.with_metrics_handler(MetricsHandler)
.with_greptime_config_options(opts.to_toml().context(error::TomlFormatSnafu)?);

View File

@@ -98,6 +98,12 @@ impl MemtableStats {
self
}
#[cfg(feature = "test")]
pub fn with_max_sequence(mut self, max_sequence: SequenceNumber) -> Self {
self.max_sequence = max_sequence;
self
}
/// Returns the estimated bytes allocated by this memtable.
pub fn bytes_allocated(&self) -> usize {
self.estimated_bytes