File tree Expand file tree Collapse file tree 5 files changed +13
-14
lines changed
Expand file tree Collapse file tree 5 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ use crate::runtime::Runtime;
2121
2222pub 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}
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ mod thread_pool;
2222
2323pub use catch_unwind:: catch_unwind;
2424pub use catch_unwind:: CatchUnwindFuture ;
25- pub use global_runtime:: GlobalHttpQueryRuntime ;
2625pub use global_runtime:: GlobalIORuntime ;
26+ pub use global_runtime:: GlobalQueryRuntime ;
2727pub use runtime:: execute_futures_in_parallel;
2828pub use runtime:: match_join_handle;
2929pub use runtime:: Dropper ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ use std::sync::Arc;
1818
1919use async_channel:: Receiver ;
2020use async_channel:: Sender ;
21- use common_base:: runtime:: GlobalHttpQueryRuntime ;
21+ use common_base:: runtime:: GlobalQueryRuntime ;
2222use common_base:: runtime:: TrySpawn ;
2323use common_catalog:: table_context:: TableContext ;
2424use 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 ( ) ) ;
Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515use common_base:: base:: GlobalInstance ;
16- use common_base:: runtime:: GlobalHttpQueryRuntime ;
1716use common_base:: runtime:: GlobalIORuntime ;
17+ use common_base:: runtime:: GlobalQueryRuntime ;
1818use common_catalog:: catalog:: CatalogManager ;
1919use common_config:: GlobalConfig ;
2020use 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 ?;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use std::time::Instant;
2020use common_base:: base:: tokio;
2121use common_base:: base:: tokio:: sync:: Mutex as TokioMutex ;
2222use common_base:: base:: tokio:: sync:: RwLock ;
23- use common_base:: runtime:: GlobalHttpQueryRuntime ;
23+ use common_base:: runtime:: GlobalQueryRuntime ;
2424use common_base:: runtime:: TrySpawn ;
2525use common_catalog:: table_context:: StageAttachment ;
2626use 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 {
You can’t perform that action at this time.
0 commit comments