@@ -42,9 +42,9 @@ use crate::api::rpc::exchange::exchange_sink::ExchangeSink;
4242use crate :: api:: rpc:: exchange:: exchange_transform:: ExchangeTransform ;
4343use crate :: api:: rpc:: exchange:: statistics_receiver:: StatisticsReceiver ;
4444use crate :: api:: rpc:: exchange:: statistics_sender:: StatisticsSender ;
45+ use crate :: api:: rpc:: flight_client:: FlightExchange ;
4546use crate :: api:: rpc:: flight_client:: FlightReceiver ;
4647use crate :: api:: rpc:: flight_client:: FlightSender ;
47- use crate :: api:: rpc:: flight_client:: NewFlightExchange ;
4848use crate :: api:: rpc:: Packet ;
4949use crate :: api:: DataExchange ;
5050use crate :: api:: DefaultExchangeInjector ;
@@ -218,7 +218,7 @@ impl DataExchangeManager {
218218 }
219219 }
220220
221- pub fn new_handle_exchange_fragment (
221+ pub fn handle_exchange_fragment (
222222 & self ,
223223 query : String ,
224224 target : String ,
@@ -228,10 +228,10 @@ impl DataExchangeManager {
228228 let queries_coordinator = unsafe { & mut * queries_coordinator_guard. deref ( ) . get ( ) } ;
229229
230230 match queries_coordinator. entry ( query) {
231- Entry :: Occupied ( mut v) => v. get_mut ( ) . new_add_fragment_exchange ( target, fragment) ,
231+ Entry :: Occupied ( mut v) => v. get_mut ( ) . add_fragment_exchange ( target, fragment) ,
232232 Entry :: Vacant ( v) => v
233233 . insert ( QueryCoordinator :: create ( ) )
234- . new_add_fragment_exchange ( target, fragment) ,
234+ . add_fragment_exchange ( target, fragment) ,
235235 }
236236 }
237237
@@ -308,12 +308,12 @@ impl DataExchangeManager {
308308 match queries_coordinator. get_mut ( & query_id) {
309309 None => Err ( ErrorCode :: Internal ( "Query not exists." ) ) ,
310310 Some ( query_coordinator) => {
311- query_coordinator. new_fragment_exchanges . clear ( ) ;
311+ query_coordinator. fragment_exchanges . clear ( ) ;
312312 let injector = DefaultExchangeInjector :: create ( ) ;
313313 let mut build_res =
314314 query_coordinator. subscribe_fragment ( & ctx, fragment_id, injector) ?;
315315
316- let exchanges = std:: mem:: take ( & mut query_coordinator. new_statistics_exchanges ) ;
316+ let exchanges = std:: mem:: take ( & mut query_coordinator. statistics_exchanges ) ;
317317 let statistics_receiver = StatisticsReceiver :: spawn_receiver ( & ctx, exchanges) ?;
318318
319319 let statistics_receiver: Mutex < StatisticsReceiver > =
@@ -396,17 +396,17 @@ struct QueryCoordinator {
396396 info : Option < QueryInfo > ,
397397 fragments_coordinator : HashMap < usize , Box < FragmentCoordinator > > ,
398398
399- new_statistics_exchanges : HashMap < String , Vec < NewFlightExchange > > ,
400- new_fragment_exchanges : HashMap < ( String , usize , u8 ) , NewFlightExchange > ,
399+ statistics_exchanges : HashMap < String , Vec < FlightExchange > > ,
400+ fragment_exchanges : HashMap < ( String , usize , u8 ) , FlightExchange > ,
401401}
402402
403403impl QueryCoordinator {
404404 pub fn create ( ) -> QueryCoordinator {
405405 QueryCoordinator {
406406 info : None ,
407407 fragments_coordinator : HashMap :: new ( ) ,
408- new_fragment_exchanges : HashMap :: new ( ) ,
409- new_statistics_exchanges : HashMap :: new ( ) ,
408+ fragment_exchanges : HashMap :: new ( ) ,
409+ statistics_exchanges : HashMap :: new ( ) ,
410410 }
411411 }
412412
@@ -415,12 +415,12 @@ impl QueryCoordinator {
415415 target : String ,
416416 ) -> Result < Receiver < Result < FlightData , Status > > > {
417417 let ( tx, rx) = async_channel:: bounded ( 8 ) ;
418- match self . new_statistics_exchanges . entry ( target) {
418+ match self . statistics_exchanges . entry ( target) {
419419 Entry :: Vacant ( v) => {
420- v. insert ( vec ! [ NewFlightExchange :: create_sender( tx) ] ) ;
420+ v. insert ( vec ! [ FlightExchange :: create_sender( tx) ] ) ;
421421 }
422422 Entry :: Occupied ( mut v) => {
423- v. get_mut ( ) . push ( NewFlightExchange :: create_sender ( tx) ) ;
423+ v. get_mut ( ) . push ( FlightExchange :: create_sender ( tx) ) ;
424424 }
425425 } ;
426426
@@ -429,10 +429,10 @@ impl QueryCoordinator {
429429
430430 pub fn add_statistics_exchanges (
431431 & mut self ,
432- exchanges : HashMap < String , NewFlightExchange > ,
432+ exchanges : HashMap < String , FlightExchange > ,
433433 ) -> Result < ( ) > {
434434 for ( source, exchange) in exchanges. into_iter ( ) {
435- match self . new_statistics_exchanges . entry ( source) {
435+ match self . statistics_exchanges . entry ( source) {
436436 Entry :: Vacant ( v) => {
437437 v. insert ( vec ! [ exchange] ) ;
438438 }
@@ -445,25 +445,25 @@ impl QueryCoordinator {
445445 Ok ( ( ) )
446446 }
447447
448- pub fn new_add_fragment_exchange (
448+ pub fn add_fragment_exchange (
449449 & mut self ,
450450 target : String ,
451451 fragment : usize ,
452452 ) -> Result < Receiver < Result < FlightData , Status > > > {
453453 let ( tx, rx) = async_channel:: bounded ( 8 ) ;
454- self . new_fragment_exchanges . insert (
454+ self . fragment_exchanges . insert (
455455 ( target, fragment, FLIGHT_SENDER ) ,
456- NewFlightExchange :: create_sender ( tx) ,
456+ FlightExchange :: create_sender ( tx) ,
457457 ) ;
458458 Ok ( rx)
459459 }
460460
461461 pub fn add_fragment_exchanges (
462462 & mut self ,
463- exchanges : HashMap < ( String , usize ) , NewFlightExchange > ,
463+ exchanges : HashMap < ( String , usize ) , FlightExchange > ,
464464 ) -> Result < ( ) > {
465465 for ( ( source, fragment) , exchange) in exchanges. into_iter ( ) {
466- self . new_fragment_exchanges
466+ self . fragment_exchanges
467467 . insert ( ( source, fragment, FLIGHT_RECEIVER ) , exchange) ;
468468 }
469469
@@ -474,7 +474,7 @@ impl QueryCoordinator {
474474 match params {
475475 ExchangeParams :: MergeExchange ( params) => {
476476 let mut exchanges = vec ! [ ] ;
477- for ( ( _target, fragment, role) , exchange) in & self . new_fragment_exchanges {
477+ for ( ( _target, fragment, role) , exchange) in & self . fragment_exchanges {
478478 if * fragment == params. fragment_id && * role == FLIGHT_SENDER {
479479 exchanges. push ( exchange. as_sender ( ) ) ;
480480 }
@@ -488,7 +488,7 @@ impl QueryCoordinator {
488488 for destination in & params. destination_ids {
489489 exchanges. push ( match destination == & params. executor_id {
490490 true => Ok ( FlightSender :: create ( async_channel:: bounded ( 1 ) . 0 ) ) ,
491- false => match self . new_fragment_exchanges . get ( & (
491+ false => match self . fragment_exchanges . get ( & (
492492 destination. clone ( ) ,
493493 params. fragment_id ,
494494 FLIGHT_SENDER ,
@@ -511,7 +511,7 @@ impl QueryCoordinator {
511511 match params {
512512 ExchangeParams :: MergeExchange ( params) => {
513513 let mut exchanges = vec ! [ ] ;
514- for ( ( _target, fragment, role) , exchange) in & self . new_fragment_exchanges {
514+ for ( ( _target, fragment, role) , exchange) in & self . fragment_exchanges {
515515 if * fragment == params. fragment_id && * role == FLIGHT_RECEIVER {
516516 exchanges. push ( exchange. as_receiver ( ) ) ;
517517 }
@@ -525,7 +525,7 @@ impl QueryCoordinator {
525525 for destination in & params. destination_ids {
526526 exchanges. push ( match destination == & params. executor_id {
527527 true => Ok ( FlightReceiver :: create ( async_channel:: bounded ( 1 ) . 1 ) ) ,
528- false => match self . new_fragment_exchanges . get ( & (
528+ false => match self . fragment_exchanges . get ( & (
529529 destination. clone ( ) ,
530530 params. fragment_id ,
531531 FLIGHT_RECEIVER ,
@@ -692,13 +692,13 @@ impl QueryCoordinator {
692692
693693 let executor = PipelineCompleteExecutor :: from_pipelines ( pipelines, executor_settings) ?;
694694
695- self . new_fragment_exchanges . clear ( ) ;
695+ self . fragment_exchanges . clear ( ) ;
696696 let info_mut = self . info . as_mut ( ) . expect ( "Query info is None" ) ;
697697 info_mut. query_executor = Some ( executor. clone ( ) ) ;
698698
699699 let query_id = info_mut. query_id . clone ( ) ;
700700 let query_ctx = info_mut. query_ctx . clone ( ) ;
701- let request_server_exchanges = std:: mem:: take ( & mut self . new_statistics_exchanges ) ;
701+ let request_server_exchanges = std:: mem:: take ( & mut self . statistics_exchanges ) ;
702702
703703 if request_server_exchanges. len ( ) != 1 {
704704 return Err ( ErrorCode :: Internal (
0 commit comments