Skip to content

Commit ec7acb7

Browse files
committed
rename GlobalHttpQueryRuntime to GolbalQueryRuntime
1 parent 4f6e4cf commit ec7acb7

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

src/common/base/src/runtime/global_runtime.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use crate::runtime::Runtime;
2121

2222
pub struct GlobalIORuntime;
2323

24-
pub struct GlobalHttpQueryRuntime(pub Runtime);
24+
pub struct GlobalQueryRuntime(pub Runtime);
2525

26-
impl GlobalHttpQueryRuntime {
26+
impl GlobalQueryRuntime {
2727
#[inline(always)]
2828
pub fn runtime<'a>(self: &'a Arc<Self>) -> &'a Runtime {
2929
&self.0
@@ -47,18 +47,17 @@ impl GlobalIORuntime {
4747
}
4848
}
4949

50-
impl GlobalHttpQueryRuntime {
50+
impl GlobalQueryRuntime {
5151
pub fn init(num_cpus: usize) -> Result<()> {
5252
let thread_num = std::cmp::max(num_cpus, num_cpus::get() / 2);
5353
let thread_num = std::cmp::max(2, thread_num);
5454

55-
let rt =
56-
Runtime::with_worker_threads(thread_num, Some("http-query-ctx-worker".to_owned()))?;
57-
GlobalInstance::set(Arc::new(GlobalHttpQueryRuntime(rt)));
55+
let rt = Runtime::with_worker_threads(thread_num, Some("g-query-worker".to_owned()))?;
56+
GlobalInstance::set(Arc::new(GlobalQueryRuntime(rt)));
5857
Ok(())
5958
}
6059

61-
pub fn instance() -> Arc<GlobalHttpQueryRuntime> {
60+
pub fn instance() -> Arc<GlobalQueryRuntime> {
6261
GlobalInstance::get()
6362
}
6463
}

src/common/base/src/runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ mod thread_pool;
2222

2323
pub use catch_unwind::catch_unwind;
2424
pub use catch_unwind::CatchUnwindFuture;
25-
pub use global_runtime::GlobalHttpQueryRuntime;
2625
pub use global_runtime::GlobalIORuntime;
26+
pub use global_runtime::GlobalQueryRuntime;
2727
pub use runtime::execute_futures_in_parallel;
2828
pub use runtime::match_join_handle;
2929
pub use runtime::Dropper;

src/query/service/src/api/rpc/exchange/statistics_sender.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::sync::Arc;
1818

1919
use async_channel::Receiver;
2020
use async_channel::Sender;
21-
use common_base::runtime::GlobalHttpQueryRuntime;
21+
use common_base::runtime::GlobalQueryRuntime;
2222
use common_base::runtime::TrySpawn;
2323
use common_catalog::table_context::TableContext;
2424
use common_exception::ErrorCode;
@@ -64,7 +64,7 @@ impl StatisticsSender {
6464
let shutdown_flag = self.shutdown_flag.clone();
6565
let shutdown_flag_receiver = self.shutdown_flag_receiver.clone();
6666

67-
let spawner = GlobalHttpQueryRuntime::instance();
67+
let spawner = GlobalQueryRuntime::instance();
6868
spawner.runtime().spawn(async move {
6969
let mut recv = Box::pin(flight_exchange.recv());
7070
let mut notified = Box::pin(shutdown_flag_receiver.recv());

src/query/service/src/global_services.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414

1515
use common_base::base::GlobalInstance;
16-
use common_base::runtime::GlobalHttpQueryRuntime;
1716
use common_base::runtime::GlobalIORuntime;
17+
use common_base::runtime::GlobalQueryRuntime;
1818
use common_catalog::catalog::CatalogManager;
1919
use common_config::GlobalConfig;
2020
use common_config::InnerConfig;
@@ -48,7 +48,7 @@ impl GlobalServices {
4848

4949
QueryLogger::init(app_name_shuffle, &config.log)?;
5050
GlobalIORuntime::init(config.storage.num_cpus as usize)?;
51-
GlobalHttpQueryRuntime::init(config.storage.num_cpus as usize)?;
51+
GlobalQueryRuntime::init(config.storage.num_cpus as usize)?;
5252

5353
// Cluster discovery.
5454
ClusterDiscovery::init(config.clone()).await?;

src/query/service/src/servers/http/v1/query/http_query.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::time::Instant;
2020
use common_base::base::tokio;
2121
use common_base::base::tokio::sync::Mutex as TokioMutex;
2222
use common_base::base::tokio::sync::RwLock;
23-
use common_base::runtime::GlobalHttpQueryRuntime;
23+
use common_base::runtime::GlobalQueryRuntime;
2424
use common_base::runtime::TrySpawn;
2525
use common_catalog::table_context::StageAttachment;
2626
use common_exception::ErrorCode;
@@ -279,7 +279,7 @@ impl HttpQuery {
279279
let query_id_clone = id.clone();
280280

281281
let schema = ExecuteState::get_schema(&sql, ctx.clone()).await?;
282-
let http_query_runtime_instance = GlobalHttpQueryRuntime::instance();
282+
let http_query_runtime_instance = GlobalQueryRuntime::instance();
283283
http_query_runtime_instance
284284
.runtime()
285285
.try_spawn(async move {

0 commit comments

Comments
 (0)