Skip to content

Commit

Permalink
chore: per review
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 committed May 16, 2024
1 parent dfd71ca commit ece07ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/cmd/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,7 @@ impl StartCommand {
fe_plugins.clone(),
table_metadata_manager.clone(),
catalog_manager.clone(),
)
.with_kv_backend(kv_backend.clone());
);
let flownode = Arc::new(flow_builder.build().await);

let builder =
Expand Down
17 changes: 3 additions & 14 deletions src/flow/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ use std::sync::Arc;
use std::time::Instant;

use api::v1::{RowDeleteRequest, RowDeleteRequests, RowInsertRequest, RowInsertRequests};
use catalog::kvbackend::KvBackendCatalogManager;
use catalog::CatalogManagerRef;
use common_base::Plugins;
use common_error::ext::BoxedError;
use common_frontend::handler::FrontendInvoker;
use common_meta::key::TableMetadataManagerRef;
use common_meta::kv_backend::KvBackendRef;
use common_runtime::JoinHandle;
use common_telemetry::{debug, info};
use datatypes::schema::ColumnSchema;
Expand Down Expand Up @@ -86,9 +85,8 @@ pub struct FlownodeBuilder {
flow_node_id: u32,
opts: FlownodeOptions,
plugins: Plugins,
kv_backend: Option<KvBackendRef>,
table_meta: TableMetadataManagerRef,
catalog_manager: Arc<KvBackendCatalogManager>,
catalog_manager: CatalogManagerRef,
}

impl FlownodeBuilder {
Expand All @@ -98,26 +96,17 @@ impl FlownodeBuilder {
opts: FlownodeOptions,
plugins: Plugins,
table_meta: TableMetadataManagerRef,
catalog_manager: Arc<KvBackendCatalogManager>,
catalog_manager: CatalogManagerRef,
) -> Self {
Self {
flow_node_id,
opts,
plugins,
kv_backend: None,
table_meta,
catalog_manager,
}
}

/// set kv backend
pub fn with_kv_backend(self, kv_backend: KvBackendRef) -> Self {
Self {
kv_backend: Some(kv_backend),
..self
}
}

/// TODO(discord9): error handling
pub async fn build(self) -> FlownodeManager {
let query_engine_factory = QueryEngineFactory::new_with_plugins(
Expand Down
3 changes: 1 addition & 2 deletions tests-integration/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ impl GreptimeDbStandaloneBuilder {
plugins.clone(),
table_metadata_manager.clone(),
catalog_manager.clone(),
)
.with_kv_backend(kv_backend.clone());
);
let flownode = Arc::new(flow_builder.build().await);

let node_manager = Arc::new(StandaloneDatanodeManager {
Expand Down

0 comments on commit ece07ad

Please sign in to comment.