mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-14 03:50:39 +00:00
chore: add a standalone flag in plugins during startup (#7974)
* chore: add a standalone flag in plugins during startup Signed-off-by: shuiyisong <xixing.sys@gmail.com> * chore: add derive Signed-off-by: shuiyisong <xixing.sys@gmail.com> --------- Signed-off-by: shuiyisong <xixing.sys@gmail.com>
This commit is contained in:
@@ -42,6 +42,7 @@ use common_meta::region_keeper::MemoryRegionKeeper;
|
||||
use common_meta::region_registry::LeaderRegionRegistry;
|
||||
use common_meta::sequence::{Sequence, SequenceBuilder};
|
||||
use common_meta::wal_provider::{WalProviderRef, build_wal_provider};
|
||||
use common_options::plugin_options::StandaloneFlag;
|
||||
use common_procedure::ProcedureManagerRef;
|
||||
use common_query::prelude::set_default_prefix;
|
||||
use common_telemetry::info;
|
||||
@@ -369,6 +370,7 @@ impl StartCommand {
|
||||
creator: InstanceCreator,
|
||||
) -> Result<(Instance, InstanceCreatorResult)> {
|
||||
let mut plugins = Plugins::new();
|
||||
plugins.insert(StandaloneFlag);
|
||||
set_default_prefix(opts.default_column_prefix.as_deref())
|
||||
.map_err(BoxedError::new)
|
||||
.context(error::BuildCliSnafu)?;
|
||||
|
||||
@@ -27,3 +27,10 @@ pub type PluginOptionsSerializerRef = Arc<dyn PluginOptionsSerializer>;
|
||||
pub trait PluginOptionsDeserializer<T: DeserializeOwned>: Send + Sync {
|
||||
fn deserialize(&self, payload: &str) -> Result<T, serde_json::Error>;
|
||||
}
|
||||
|
||||
/// A flag for stating the standalone mode in the plugins.
|
||||
///
|
||||
/// The standalone build and start process calls `setup_frontend_plugins` and `setup_datanode_plugins`,
|
||||
/// so we add a flag to the plugins to indicate that the plugins are running in the standalone mode.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct StandaloneFlag;
|
||||
|
||||
Reference in New Issue
Block a user