mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-30 03:40:37 +00:00
chore: add more fields to DdlManagerConfigureContext (#7310)
* feat: add more context for configurator * move the flow grpc configure context to plugins crate * move context to plugins crate * add more fields * fix: cargo check * refactor: some * refactor some * adjust context * fix: cargo check * fix: ut
This commit is contained in:
@@ -9,6 +9,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
auth.workspace = true
|
||||
catalog.workspace = true
|
||||
clap.workspace = true
|
||||
cli.workspace = true
|
||||
common-base.workspace = true
|
||||
@@ -17,6 +18,7 @@ common-meta.workspace = true
|
||||
datanode.workspace = true
|
||||
flow.workspace = true
|
||||
frontend.workspace = true
|
||||
meta-client.workspace = true
|
||||
meta-srv.workspace = true
|
||||
serde.workspace = true
|
||||
snafu.workspace = true
|
||||
|
||||
@@ -30,3 +30,20 @@ pub async fn setup_flownode_plugins(
|
||||
pub async fn start_flownode_plugins(_plugins: Plugins) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub mod context {
|
||||
use std::sync::Arc;
|
||||
|
||||
use catalog::CatalogManagerRef;
|
||||
use common_meta::FlownodeId;
|
||||
use common_meta::kv_backend::KvBackendRef;
|
||||
use flow::FrontendClient;
|
||||
|
||||
/// The context for `GrpcBuilderConfiguratorRef` in flownode.
|
||||
pub struct GrpcConfigureContext {
|
||||
pub kv_backend: KvBackendRef,
|
||||
pub fe_client: Arc<FrontendClient>,
|
||||
pub flownode_id: FlownodeId,
|
||||
pub catalog_manager: CatalogManagerRef,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,3 +40,25 @@ pub async fn setup_frontend_plugins(
|
||||
pub async fn start_frontend_plugins(_plugins: Plugins) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub mod context {
|
||||
use std::sync::Arc;
|
||||
|
||||
use flow::FrontendClient;
|
||||
use meta_client::MetaClientRef;
|
||||
|
||||
/// The context for [`catalog::kvbackend::CatalogManagerConfiguratorRef`] in standalone or
|
||||
/// distributed.
|
||||
pub enum CatalogManagerConfigureContext {
|
||||
Distributed(DistributedCatalogManagerConfigureContext),
|
||||
Standalone(StandaloneCatalogManagerConfigureContext),
|
||||
}
|
||||
|
||||
pub struct DistributedCatalogManagerConfigureContext {
|
||||
pub meta_client: MetaClientRef,
|
||||
}
|
||||
|
||||
pub struct StandaloneCatalogManagerConfigureContext {
|
||||
pub fe_client: Arc<FrontendClient>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
// limitations under the License.
|
||||
|
||||
mod cli;
|
||||
mod datanode;
|
||||
mod flownode;
|
||||
mod frontend;
|
||||
pub mod datanode;
|
||||
pub mod flownode;
|
||||
pub mod frontend;
|
||||
mod meta_srv;
|
||||
mod options;
|
||||
mod standalone;
|
||||
pub mod standalone;
|
||||
|
||||
pub use cli::SubCommand;
|
||||
pub use datanode::{setup_datanode_plugins, start_datanode_plugins};
|
||||
|
||||
@@ -33,3 +33,18 @@ pub async fn setup_standalone_plugins(
|
||||
pub async fn start_standalone_plugins(_plugins: Plugins) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub mod context {
|
||||
use std::sync::Arc;
|
||||
|
||||
use catalog::CatalogManagerRef;
|
||||
use common_meta::kv_backend::KvBackendRef;
|
||||
use flow::FrontendClient;
|
||||
|
||||
/// The context for [`common_meta::ddl_manager::DdlManagerConfiguratorRef`] in standalone.
|
||||
pub struct DdlManagerConfigureContext {
|
||||
pub kv_backend: KvBackendRef,
|
||||
pub fe_client: Arc<FrontendClient>,
|
||||
pub catalog_manager: CatalogManagerRef,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user