mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
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:
@@ -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)?;
|
||||
|
||||
|
||||
@@ -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)?);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user