feat(frontend): migrate insert to region server (#2318)

* feat(frontend): migrate insert to region server

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* refactor: move converter to Inserter

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* chore: rename convert function

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: address comments

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: address comments

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: add span id

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* fix: compilation

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

* retrigger action

* retrigger action

---------

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
This commit is contained in:
Zhenchi
2023-09-05 11:23:54 +08:00
committed by Ruihang Xia
parent 3eccb36047
commit 7dde9ce3ce
22 changed files with 837 additions and 609 deletions

View File

@@ -21,6 +21,7 @@ use common_telemetry::info;
use common_telemetry::logging::LoggingOptions;
use datanode::datanode::{Datanode, DatanodeOptions, ProcedureConfig, StorageConfig};
use datanode::instance::InstanceRef;
use datanode::region_server::RegionServer;
use frontend::frontend::FrontendOptions;
use frontend::instance::{FrontendInstance, Instance as FeInstance};
use frontend::service_config::{
@@ -293,7 +294,8 @@ impl StartCommand {
.context(StartDatanodeSnafu)?;
// TODO: build frontend instance like in distributed mode
let mut frontend = build_frontend(plugins.clone(), todo!()).await?;
let mut frontend =
build_frontend(plugins.clone(), todo!(), datanode.region_server()).await?;
frontend
.build_servers(&fe_opts)
@@ -308,8 +310,9 @@ impl StartCommand {
async fn build_frontend(
plugins: Arc<Plugins>,
datanode_instance: InstanceRef,
region_server: RegionServer,
) -> Result<FeInstance> {
let mut frontend_instance = FeInstance::try_new_standalone(datanode_instance.clone())
let mut frontend_instance = FeInstance::try_new_standalone(datanode_instance, region_server)
.await
.context(StartFrontendSnafu)?;
frontend_instance.set_plugins(plugins.clone());