Skip to content

Commit

Permalink
fix: auto_create_table without ceresmeta
Browse files Browse the repository at this point in the history
  • Loading branch information
chunshao90 committed May 22, 2023
1 parent 7419d0c commit 8cb63ef
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 123 deletions.
9 changes: 8 additions & 1 deletion proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::{

use ::http::StatusCode;
use catalog::schema::{
CreateOptions, CreateTableRequest, DropOptions, DropTableRequest, SchemaRef,
CreateOptions, CreateTableRequest, DropOptions, DropTableRequest, NameRef, SchemaRef,
};
use ceresdbproto::storage::{
storage_service_client::StorageServiceClient, PrometheusRemoteQueryRequest,
Expand Down Expand Up @@ -70,6 +70,7 @@ pub struct Proxy<Q> {
schema_config_provider: SchemaConfigProviderRef,
hotspot_recorder: Arc<HotspotRecorder>,
engine_runtimes: Arc<EngineRuntimes>,
cluster_with_meta: bool,
}

impl<Q: QueryExecutor + 'static> Proxy<Q> {
Expand All @@ -84,6 +85,7 @@ impl<Q: QueryExecutor + 'static> Proxy<Q> {
schema_config_provider: SchemaConfigProviderRef,
hotspot_config: hotspot::Config,
engine_runtimes: Arc<EngineRuntimes>,
cluster_with_meta: bool,
) -> Self {
let forwarder = Arc::new(Forwarder::new(
forward_config,
Expand All @@ -104,13 +106,18 @@ impl<Q: QueryExecutor + 'static> Proxy<Q> {
schema_config_provider,
hotspot_recorder,
engine_runtimes,
cluster_with_meta,
}
}

pub fn instance(&self) -> InstanceRef<Q> {
self.instance.clone()
}

fn default_catalog_name(&self) -> NameRef {
self.instance.catalog_manager.default_catalog_name()
}

async fn maybe_forward_prom_remote_query(
&self,
metric: String,
Expand Down
Loading

0 comments on commit 8cb63ef

Please sign in to comment.