mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-27 16:32:54 +00:00
Compare commits
1 Commits
bench_hydr
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
710a68d2d6 |
@@ -27,6 +27,9 @@
|
|||||||
<a href="https://greptime.com/slack"><img src="https://img.shields.io/badge/slack-GreptimeDB-0abd59?logo=slack" alt="slack" /></a>
|
<a href="https://greptime.com/slack"><img src="https://img.shields.io/badge/slack-GreptimeDB-0abd59?logo=slack" alt="slack" /></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Our default branch has changed from `develop` to `main` (issue [#3025](https://github.com/GreptimeTeam/greptimedb/issues/3025)). Please update your local repository to use the `main` branch.
|
||||||
|
|
||||||
## What is GreptimeDB
|
## What is GreptimeDB
|
||||||
|
|
||||||
GreptimeDB is an open-source time-series database with a special focus on
|
GreptimeDB is an open-source time-series database with a special focus on
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ use paste::paste;
|
|||||||
use crate::{Builder, JoinHandle, Runtime};
|
use crate::{Builder, JoinHandle, Runtime};
|
||||||
|
|
||||||
const READ_WORKERS: usize = 8;
|
const READ_WORKERS: usize = 8;
|
||||||
const WRITE_WORKERS: usize = 16;
|
const WRITE_WORKERS: usize = 8;
|
||||||
const BG_WORKERS: usize = 8;
|
const BG_WORKERS: usize = 8;
|
||||||
|
|
||||||
pub fn create_runtime(runtime_name: &str, thread_name: &str, worker_threads: usize) -> Runtime {
|
pub fn create_runtime(runtime_name: &str, thread_name: &str, worker_threads: usize) -> Runtime {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ pub mod standalone;
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use api::v1::RowInsertRequests;
|
|
||||||
use api::v1::meta::Role;
|
use api::v1::meta::Role;
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use auth::{PermissionChecker, PermissionCheckerRef, PermissionReq};
|
use auth::{PermissionChecker, PermissionCheckerRef, PermissionReq};
|
||||||
@@ -76,7 +75,6 @@ use sql::statements::copy::CopyTable;
|
|||||||
use sql::statements::statement::Statement;
|
use sql::statements::statement::Statement;
|
||||||
use sqlparser::ast::ObjectName;
|
use sqlparser::ast::ObjectName;
|
||||||
pub use standalone::StandaloneDatanodeManager;
|
pub use standalone::StandaloneDatanodeManager;
|
||||||
use tokio::sync::mpsc::UnboundedSender;
|
|
||||||
|
|
||||||
use crate::error::{
|
use crate::error::{
|
||||||
self, Error, ExecLogicalPlanSnafu, ExecutePromqlSnafu, ExternalSnafu, ParseSqlSnafu,
|
self, Error, ExecLogicalPlanSnafu, ExecutePromqlSnafu, ExternalSnafu, ParseSqlSnafu,
|
||||||
@@ -121,7 +119,6 @@ pub struct Instance {
|
|||||||
inserter: InserterRef,
|
inserter: InserterRef,
|
||||||
deleter: DeleterRef,
|
deleter: DeleterRef,
|
||||||
export_metrics_task: Option<ExportMetricsTask>,
|
export_metrics_task: Option<ExportMetricsTask>,
|
||||||
proxy_sender: Option<UnboundedSender<RowInsertRequests>>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use api::v1::greptime_database_client::GreptimeDatabaseClient;
|
|
||||||
use api::v1::GreptimeRequest;
|
|
||||||
use catalog::kvbackend::KvBackendCatalogManager;
|
use catalog::kvbackend::KvBackendCatalogManager;
|
||||||
use common_base::Plugins;
|
use common_base::Plugins;
|
||||||
use common_meta::cache_invalidator::{CacheInvalidatorRef, DummyCacheInvalidator};
|
use common_meta::cache_invalidator::{CacheInvalidatorRef, DummyCacheInvalidator};
|
||||||
@@ -29,7 +27,6 @@ use operator::statement::StatementExecutor;
|
|||||||
use operator::table::TableMutationOperator;
|
use operator::table::TableMutationOperator;
|
||||||
use partition::manager::PartitionRuleManager;
|
use partition::manager::PartitionRuleManager;
|
||||||
use query::QueryEngineFactory;
|
use query::QueryEngineFactory;
|
||||||
use tokio::sync::mpsc::unbounded_channel;
|
|
||||||
|
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
use crate::heartbeat::HeartbeatTask;
|
use crate::heartbeat::HeartbeatTask;
|
||||||
@@ -137,20 +134,6 @@ impl FrontendBuilder {
|
|||||||
|
|
||||||
plugins.insert::<StatementExecutorRef>(statement_executor.clone());
|
plugins.insert::<StatementExecutorRef>(statement_executor.clone());
|
||||||
|
|
||||||
let addr = std::env::var("FLOW_ADDR").unwrap_or("http://[::1]:14514".to_string());
|
|
||||||
let (send, mut recv) = unbounded_channel();
|
|
||||||
tokio::spawn(async move {
|
|
||||||
let conn = tonic::transport::Endpoint::new(addr)
|
|
||||||
.unwrap()
|
|
||||||
.connect_lazy();
|
|
||||||
let mut client = GreptimeDatabaseClient::new(conn);
|
|
||||||
let mut outer_request = GreptimeRequest::default();
|
|
||||||
while let Some(request) = recv.recv().await {
|
|
||||||
outer_request.request =
|
|
||||||
Some(api::v1::greptime_request::Request::RowInserts(request));
|
|
||||||
let _response = client.handle(outer_request.clone()).await.unwrap();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Ok(Instance {
|
Ok(Instance {
|
||||||
catalog_manager,
|
catalog_manager,
|
||||||
script_executor,
|
script_executor,
|
||||||
@@ -162,7 +145,6 @@ impl FrontendBuilder {
|
|||||||
inserter,
|
inserter,
|
||||||
deleter,
|
deleter,
|
||||||
export_metrics_task: None,
|
export_metrics_task: None,
|
||||||
proxy_sender: Some(send),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
use api::v1::ddl_request::{Expr as DdlExpr, Expr};
|
use api::v1::ddl_request::{Expr as DdlExpr, Expr};
|
||||||
use api::v1::greptime_request::Request;
|
use api::v1::greptime_request::Request;
|
||||||
use api::v1::query_request::Query;
|
use api::v1::query_request::Query;
|
||||||
@@ -22,7 +20,6 @@ use async_trait::async_trait;
|
|||||||
use auth::{PermissionChecker, PermissionCheckerRef, PermissionReq};
|
use auth::{PermissionChecker, PermissionCheckerRef, PermissionReq};
|
||||||
use common_meta::table_name::TableName;
|
use common_meta::table_name::TableName;
|
||||||
use common_query::Output;
|
use common_query::Output;
|
||||||
use common_telemetry::info;
|
|
||||||
use query::parser::PromQuery;
|
use query::parser::PromQuery;
|
||||||
use servers::interceptor::{GrpcQueryInterceptor, GrpcQueryInterceptorRef};
|
use servers::interceptor::{GrpcQueryInterceptor, GrpcQueryInterceptorRef};
|
||||||
use servers::query_handler::grpc::GrpcQueryHandler;
|
use servers::query_handler::grpc::GrpcQueryHandler;
|
||||||
@@ -192,8 +189,6 @@ impl Instance {
|
|||||||
requests: RowInsertRequests,
|
requests: RowInsertRequests,
|
||||||
ctx: QueryContextRef,
|
ctx: QueryContextRef,
|
||||||
) -> Result<Output> {
|
) -> Result<Output> {
|
||||||
self.proxy_sender.as_ref().map(|s|s.send(requests.clone()));
|
|
||||||
|
|
||||||
self.inserter
|
self.inserter
|
||||||
.handle_row_inserts(requests, ctx, self.statement_executor.as_ref())
|
.handle_row_inserts(requests, ctx, self.statement_executor.as_ref())
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user