1use crate::codec::{set_distributed_user_codec, set_distributed_user_codec_arc};
2use crate::config_extension_ext::{
3 set_distributed_option_extension, set_distributed_option_extension_from_headers,
4};
5use crate::events::{
6 DesiredTaskCountHandler, DesiredTaskCountHandlers, RouteTasksHandler, RouteTasksHandlers,
7 ScaleUpLeafNodeHandler, ScaleUpLeafNodeHandlers, WorkerPlanRewriteHandler,
8 WorkerPlanRewriteHandlers,
9};
10use crate::passthrough_headers::set_passthrough_headers;
11use crate::protocol::set_distributed_channel_resolver;
12use crate::work_unit_feed::set_distributed_work_unit_feed;
13use crate::worker_resolver::set_distributed_worker_resolver;
14use crate::{
15 ChannelResolver, DistributedConfig, LocalWorkerContext, WorkUnitFeed, WorkUnitFeedProvider,
16 WorkerResolver, get_distributed_worker_resolver,
17};
18use datafusion::common::DataFusionError;
19use datafusion::config::ConfigExtension;
20use datafusion::execution::{SessionState, SessionStateBuilder};
21use datafusion::physical_plan::ExecutionPlan;
22use datafusion::prelude::{SessionConfig, SessionContext};
23use datafusion_proto::physical_plan::PhysicalExtensionCodec;
24use delegate::delegate;
25use http::HeaderMap;
26use std::sync::Arc;
27
28pub trait DistributedExt: Sized {
30 fn with_distributed_option_extension<T: ConfigExtension + Default>(self, t: T) -> Self;
77
78 fn set_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T);
80
81 fn with_distributed_option_extension_from_headers<T: ConfigExtension + Default>(
130 self,
131 headers: &HeaderMap,
132 ) -> Result<Self, DataFusionError>;
133
134 fn set_distributed_option_extension_from_headers<T: ConfigExtension + Default>(
136 &mut self,
137 headers: &HeaderMap,
138 ) -> Result<(), DataFusionError>;
139
140 fn with_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(self, codec: T) -> Self;
181
182 fn set_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(&mut self, codec: T);
184
185 fn with_distributed_user_codec_arc(self, codec: Arc<dyn PhysicalExtensionCodec>) -> Self;
187
188 fn set_distributed_user_codec_arc(&mut self, codec: Arc<dyn PhysicalExtensionCodec>);
190
191 fn with_distributed_worker_resolver<T: WorkerResolver + 'static>(self, resolver: T) -> Self;
227
228 fn set_distributed_worker_resolver<T: WorkerResolver + 'static>(&mut self, resolver: T);
230
231 fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(
275 self,
276 resolver: T,
277 ) -> Self;
278
279 fn set_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(
281 &mut self,
282 resolver: T,
283 );
284
285 fn with_distributed_file_scan_config_bytes_per_partition(
313 self,
314 bytes_per_partition: usize,
315 ) -> Result<Self, DataFusionError>;
316
317 fn set_distributed_file_scan_config_bytes_per_partition(
319 &mut self,
320 bytes_per_partition: usize,
321 ) -> Result<(), DataFusionError>;
322
323 fn with_distributed_cardinality_effect_task_scale_factor(
360 self,
361 factor: f64,
362 ) -> Result<Self, DataFusionError>;
363
364 fn set_distributed_cardinality_effect_task_scale_factor(
367 &mut self,
368 factor: f64,
369 ) -> Result<(), DataFusionError>;
370
371 fn with_distributed_metrics_collection(self, enabled: bool) -> Result<Self, DataFusionError>;
374
375 fn set_distributed_metrics_collection(&mut self, enabled: bool) -> Result<(), DataFusionError>;
377
378 fn with_distributed_children_isolator_unions(
397 self,
398 enabled: bool,
399 ) -> Result<Self, DataFusionError>;
400
401 fn set_distributed_children_isolator_unions(
403 &mut self,
404 enabled: bool,
405 ) -> Result<(), DataFusionError>;
406
407 fn with_distributed_broadcast_joins(self, enabled: bool) -> Result<Self, DataFusionError>;
414
415 fn set_distributed_broadcast_joins(&mut self, enabled: bool) -> Result<(), DataFusionError>;
417
418 #[cfg(feature = "grpc")]
419 fn with_distributed_compression(
423 self,
424 compression: Option<arrow_ipc::CompressionType>,
425 ) -> Result<Self, DataFusionError>;
426
427 #[cfg(feature = "grpc")]
428 fn set_distributed_compression(
430 &mut self,
431 compression: Option<arrow_ipc::CompressionType>,
432 ) -> Result<(), DataFusionError>;
433
434 fn with_distributed_shuffle_batch_size(
440 self,
441 batch_size: usize,
442 ) -> Result<Self, DataFusionError>;
443
444 fn set_distributed_shuffle_batch_size(
446 &mut self,
447 batch_size: usize,
448 ) -> Result<(), DataFusionError>;
449
450 fn with_distributed_passthrough_headers(
472 self,
473 headers: HeaderMap,
474 ) -> Result<Self, DataFusionError>;
475
476 fn set_distributed_passthrough_headers(
478 &mut self,
479 headers: HeaderMap,
480 ) -> Result<(), DataFusionError>;
481
482 fn with_distributed_max_tasks_per_stage(
486 self,
487 max_tasks_per_stage: usize,
488 ) -> Result<Self, DataFusionError>;
489
490 fn set_distributed_max_tasks_per_stage(
492 &mut self,
493 max_tasks_per_stage: usize,
494 ) -> Result<(), DataFusionError>;
495
496 fn with_distributed_partial_reduce(self, enabled: bool) -> Result<Self, DataFusionError>;
501
502 fn set_distributed_partial_reduce(&mut self, enabled: bool) -> Result<(), DataFusionError>;
504
505 fn with_distributed_worker_connection_buffer_budget_bytes(
510 self,
511 budget_bytes: usize,
512 ) -> Result<Self, DataFusionError>;
513
514 fn set_distributed_worker_connection_buffer_budget_bytes(
517 &mut self,
518 budget_bytes: usize,
519 ) -> Result<(), DataFusionError>;
520
521 fn with_distributed_work_unit_feed<T, P, F>(self, getter: F) -> Self
533 where
534 T: ExecutionPlan + 'static,
535 P: WorkUnitFeedProvider + 'static,
536 P::WorkUnit: 'static,
537 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
538
539 fn set_distributed_work_unit_feed<T, P, F>(&mut self, getter: F)
541 where
542 T: ExecutionPlan + 'static,
543 P: WorkUnitFeedProvider + 'static,
544 P::WorkUnit: 'static,
545 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
546
547 fn with_distributed_dynamic_task_count(self, enabled: bool) -> Result<Self, DataFusionError>;
550
551 fn set_distributed_dynamic_task_count(&mut self, enabled: bool) -> Result<(), DataFusionError>;
553
554 fn with_distributed_dynamic_bytes_per_partition(
557 self,
558 dynamic_bytes_per_partition: usize,
559 ) -> Result<Self, DataFusionError>;
560
561 fn set_distributed_dynamic_bytes_per_partition(
564 &mut self,
565 dynamic_bytes_per_partition: usize,
566 ) -> Result<(), DataFusionError>;
567
568 fn with_distributed_local_worker_context(
571 self,
572 local_worker_context: LocalWorkerContext,
573 ) -> Self;
574
575 fn set_distributed_local_worker_context(&mut self, local_worker_context: LocalWorkerContext);
578
579 fn with_distributed_desired_task_count_handler<T: DesiredTaskCountHandler>(
605 self,
606 handler: T,
607 ) -> Self;
608
609 fn set_distributed_desired_task_count_handler<T: DesiredTaskCountHandler>(
612 &mut self,
613 handler: T,
614 );
615
616 fn with_distributed_scale_up_leaf_node_handler<T: ScaleUpLeafNodeHandler>(
654 self,
655 handler: T,
656 ) -> Self;
657
658 fn set_distributed_scale_up_leaf_node_handler<T: ScaleUpLeafNodeHandler>(&mut self, handler: T);
661
662 fn with_distributed_route_tasks_handler<T: RouteTasksHandler>(self, handler: T) -> Self;
692
693 fn set_distributed_route_tasks_handler<T: RouteTasksHandler>(&mut self, handler: T);
696
697 fn with_distributed_worker_plan_rewrite_handler<T: WorkerPlanRewriteHandler>(
732 self,
733 handler: T,
734 ) -> Self;
735
736 fn set_distributed_worker_plan_rewrite_handler<T: WorkerPlanRewriteHandler>(
739 &mut self,
740 handler: T,
741 );
742}
743
744pub trait DistributedGetterExt: Sized {
746 fn get_distributed_worker_resolver(&self) -> Result<Arc<dyn WorkerResolver>, DataFusionError>;
748}
749
750impl DistributedExt for SessionConfig {
751 fn set_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T) {
752 set_distributed_option_extension(self, t)
753 }
754
755 fn set_distributed_option_extension_from_headers<T: ConfigExtension + Default>(
756 &mut self,
757 headers: &HeaderMap,
758 ) -> Result<(), DataFusionError> {
759 set_distributed_option_extension_from_headers::<T>(self, headers)?;
760 Ok(())
761 }
762
763 fn set_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(&mut self, codec: T) {
764 set_distributed_user_codec(self, codec)
765 }
766
767 fn set_distributed_user_codec_arc(&mut self, codec: Arc<dyn PhysicalExtensionCodec>) {
768 set_distributed_user_codec_arc(self, codec)
769 }
770
771 fn set_distributed_worker_resolver<T: WorkerResolver + 'static>(&mut self, resolver: T) {
772 set_distributed_worker_resolver(self, resolver);
773 }
774
775 fn set_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(
776 &mut self,
777 resolver: T,
778 ) {
779 set_distributed_channel_resolver(self, resolver);
780 }
781
782 fn set_distributed_file_scan_config_bytes_per_partition(
783 &mut self,
784 bytes_per_partition: usize,
785 ) -> Result<(), DataFusionError> {
786 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
787 d_cfg.file_scan_config_bytes_per_partition = bytes_per_partition;
788 Ok(())
789 }
790
791 fn set_distributed_cardinality_effect_task_scale_factor(
792 &mut self,
793 factor: f64,
794 ) -> Result<(), DataFusionError> {
795 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
796 d_cfg.cardinality_task_count_factor = factor;
797 Ok(())
798 }
799
800 fn set_distributed_metrics_collection(&mut self, enabled: bool) -> Result<(), DataFusionError> {
801 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
802 d_cfg.collect_metrics = enabled;
803 Ok(())
804 }
805
806 fn set_distributed_children_isolator_unions(
807 &mut self,
808 enabled: bool,
809 ) -> Result<(), DataFusionError> {
810 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
811 d_cfg.children_isolator_unions = enabled;
812 Ok(())
813 }
814
815 fn set_distributed_broadcast_joins(&mut self, enabled: bool) -> Result<(), DataFusionError> {
816 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
817 d_cfg.broadcast_joins = enabled;
818 Ok(())
819 }
820
821 #[cfg(feature = "grpc")]
822 fn set_distributed_compression(
823 &mut self,
824 compression: Option<arrow_ipc::CompressionType>,
825 ) -> Result<(), DataFusionError> {
826 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
827 d_cfg.compression = match compression {
828 Some(arrow_ipc::CompressionType::ZSTD) => "zstd".to_string(),
829 Some(arrow_ipc::CompressionType::LZ4_FRAME) => "lz4".to_string(),
830 _ => "none".to_string(),
831 };
832 Ok(())
833 }
834
835 fn set_distributed_shuffle_batch_size(
836 &mut self,
837 batch_size: usize,
838 ) -> Result<(), DataFusionError> {
839 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
840 d_cfg.shuffle_batch_size = batch_size;
841 Ok(())
842 }
843
844 fn set_distributed_passthrough_headers(
845 &mut self,
846 headers: HeaderMap,
847 ) -> Result<(), DataFusionError> {
848 set_passthrough_headers(self, headers)
849 }
850
851 fn set_distributed_max_tasks_per_stage(
852 &mut self,
853 max_tasks_per_stage: usize,
854 ) -> Result<(), DataFusionError> {
855 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
856 d_cfg.max_tasks_per_stage = max_tasks_per_stage;
857 Ok(())
858 }
859
860 fn set_distributed_partial_reduce(&mut self, enabled: bool) -> Result<(), DataFusionError> {
861 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
862 d_cfg.partial_reduce = enabled;
863 Ok(())
864 }
865
866 fn set_distributed_worker_connection_buffer_budget_bytes(
867 &mut self,
868 budget_bytes: usize,
869 ) -> Result<(), DataFusionError> {
870 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
871 d_cfg.worker_connection_buffer_budget_bytes = budget_bytes;
872 Ok(())
873 }
874
875 fn set_distributed_work_unit_feed<T, P, F>(&mut self, getter: F)
876 where
877 T: ExecutionPlan + 'static,
878 P: WorkUnitFeedProvider + 'static,
879 P::WorkUnit: 'static,
880 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static,
881 {
882 set_distributed_work_unit_feed(self, move |plan: &Arc<dyn ExecutionPlan>| {
883 plan.downcast_ref::<T>().and_then(&getter)
884 })
885 }
886
887 fn set_distributed_dynamic_task_count(&mut self, enabled: bool) -> Result<(), DataFusionError> {
888 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
889 d_cfg.dynamic_task_count = enabled;
890 Ok(())
891 }
892
893 fn set_distributed_dynamic_bytes_per_partition(
894 &mut self,
895 dynamic_bytes_per_partition: usize,
896 ) -> Result<(), DataFusionError> {
897 let d_cfg = DistributedConfig::from_config_options_mut(self.options_mut())?;
898 d_cfg.dynamic_bytes_per_partition = dynamic_bytes_per_partition;
899 Ok(())
900 }
901
902 fn set_distributed_local_worker_context(&mut self, local_worker_context: LocalWorkerContext) {
903 self.set_extension(Arc::new(local_worker_context));
904 }
905
906 fn set_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(&mut self, h: H) {
907 DesiredTaskCountHandlers::push_custom(self, Arc::new(h))
908 }
909
910 fn set_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(&mut self, h: H) {
911 ScaleUpLeafNodeHandlers::push_custom(self, Arc::new(h));
912 }
913
914 fn set_distributed_route_tasks_handler<H: RouteTasksHandler>(&mut self, h: H) {
915 RouteTasksHandlers::push_custom(self, Arc::new(h));
916 }
917
918 fn set_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(&mut self, h: H) {
919 WorkerPlanRewriteHandlers::push_custom(self, Arc::new(h));
920 }
921
922 delegate! {
923 to self {
924 #[call(set_distributed_option_extension)]
925 #[expr($;self)]
926 fn with_distributed_option_extension<T: ConfigExtension + Default>(mut self, t: T) -> Self;
927
928 #[call(set_distributed_option_extension_from_headers)]
929 #[expr($?;Ok(self))]
930 fn with_distributed_option_extension_from_headers<T: ConfigExtension + Default>(mut self, headers: &HeaderMap) -> Result<Self, DataFusionError>;
931
932 #[call(set_distributed_user_codec)]
933 #[expr($;self)]
934 fn with_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(mut self, codec: T) -> Self;
935
936 #[call(set_distributed_user_codec_arc)]
937 #[expr($;self)]
938 fn with_distributed_user_codec_arc(mut self, codec: Arc<dyn PhysicalExtensionCodec>) -> Self;
939
940 #[call(set_distributed_worker_resolver)]
941 #[expr($;self)]
942 fn with_distributed_worker_resolver<T: WorkerResolver + 'static>(mut self, resolver: T) -> Self;
943
944 #[call(set_distributed_channel_resolver)]
945 #[expr($;self)]
946 fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(mut self, resolver: T) -> Self;
947
948 #[call(set_distributed_file_scan_config_bytes_per_partition)]
949 #[expr($?;Ok(self))]
950 fn with_distributed_file_scan_config_bytes_per_partition(mut self, bytes_per_partition: usize) -> Result<Self, DataFusionError>;
951
952 #[call(set_distributed_cardinality_effect_task_scale_factor)]
953 #[expr($?;Ok(self))]
954 fn with_distributed_cardinality_effect_task_scale_factor(mut self, factor: f64) -> Result<Self, DataFusionError>;
955
956 #[call(set_distributed_metrics_collection)]
957 #[expr($?;Ok(self))]
958 fn with_distributed_metrics_collection(mut self, enabled: bool) -> Result<Self, DataFusionError>;
959
960 #[call(set_distributed_children_isolator_unions)]
961 #[expr($?;Ok(self))]
962 fn with_distributed_children_isolator_unions(mut self, enabled: bool) -> Result<Self, DataFusionError>;
963
964 #[call(set_distributed_broadcast_joins)]
965 #[expr($?;Ok(self))]
966 fn with_distributed_broadcast_joins(mut self, enabled: bool) -> Result<Self, DataFusionError>;
967
968 #[call(set_distributed_compression)]
969 #[expr($?;Ok(self))]
970 #[cfg(feature = "grpc")]
971 fn with_distributed_compression(mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<Self, DataFusionError>;
972
973 #[call(set_distributed_shuffle_batch_size)]
974 #[expr($?;Ok(self))]
975 fn with_distributed_shuffle_batch_size(mut self, batch_size: usize) -> Result<Self, DataFusionError>;
976
977 #[call(set_distributed_passthrough_headers)]
978 #[expr($?;Ok(self))]
979 fn with_distributed_passthrough_headers(mut self, headers: HeaderMap) -> Result<Self, DataFusionError>;
980
981 #[call(set_distributed_max_tasks_per_stage)]
982 #[expr($?;Ok(self))]
983 fn with_distributed_max_tasks_per_stage(mut self, max_tasks_per_stage: usize) -> Result<Self, DataFusionError>;
984
985 #[call(set_distributed_partial_reduce)]
986 #[expr($?;Ok(self))]
987 fn with_distributed_partial_reduce(mut self, enabled: bool) -> Result<Self, DataFusionError>;
988
989 #[call(set_distributed_worker_connection_buffer_budget_bytes)]
990 #[expr($?;Ok(self))]
991 fn with_distributed_worker_connection_buffer_budget_bytes(mut self, budget_bytes: usize) -> Result<Self, DataFusionError>;
992
993 #[call(set_distributed_work_unit_feed)]
994 #[expr($;self)]
995 fn with_distributed_work_unit_feed<T, P, F>(mut self, getter: F) -> Self
996 where
997 T: ExecutionPlan + 'static,
998 P: WorkUnitFeedProvider + 'static,
999 P::WorkUnit: 'static,
1000 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1001
1002 #[call(set_distributed_dynamic_task_count)]
1003 #[expr($?;Ok(self))]
1004 fn with_distributed_dynamic_task_count(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1005
1006 #[call(set_distributed_dynamic_bytes_per_partition)]
1007 #[expr($?;Ok(self))]
1008 fn with_distributed_dynamic_bytes_per_partition(mut self, dynamic_bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1009
1010 #[call(set_distributed_local_worker_context)]
1011 #[expr($;self)]
1012 fn with_distributed_local_worker_context(mut self, local_worker_context: LocalWorkerContext) -> Self;
1013
1014 #[call(set_distributed_desired_task_count_handler)]
1015 #[expr($;self)]
1016 fn with_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(mut self, h: H) -> Self;
1017
1018 #[call(set_distributed_scale_up_leaf_node_handler)]
1019 #[expr($;self)]
1020 fn with_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(mut self, h: H) -> Self;
1021
1022 #[call(set_distributed_route_tasks_handler)]
1023 #[expr($;self)]
1024 fn with_distributed_route_tasks_handler<H: RouteTasksHandler>(mut self, h: H) -> Self;
1025
1026 #[call(set_distributed_worker_plan_rewrite_handler)]
1027 #[expr($;self)]
1028 fn with_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(mut self, h: H) -> Self;
1029 }
1030 }
1031}
1032impl DistributedGetterExt for SessionConfig {
1033 fn get_distributed_worker_resolver(&self) -> Result<Arc<dyn WorkerResolver>, DataFusionError> {
1034 get_distributed_worker_resolver(self)
1035 }
1036}
1037
1038impl DistributedExt for SessionStateBuilder {
1039 delegate! {
1040 to self.config().get_or_insert_default() {
1041 fn set_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T);
1042 #[call(set_distributed_option_extension)]
1043 #[expr($;self)]
1044 fn with_distributed_option_extension<T: ConfigExtension + Default>(mut self, t: T) -> Self;
1045
1046 fn set_distributed_option_extension_from_headers<T: ConfigExtension + Default>(&mut self, h: &HeaderMap) -> Result<(), DataFusionError>;
1047 #[call(set_distributed_option_extension_from_headers)]
1048 #[expr($?;Ok(self))]
1049 fn with_distributed_option_extension_from_headers<T: ConfigExtension + Default>(mut self, headers: &HeaderMap) -> Result<Self, DataFusionError>;
1050
1051 fn set_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(&mut self, codec: T);
1052 #[call(set_distributed_user_codec)]
1053 #[expr($;self)]
1054 fn with_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(mut self, codec: T) -> Self;
1055
1056 fn set_distributed_user_codec_arc(&mut self, codec: Arc<dyn PhysicalExtensionCodec>);
1057 #[call(set_distributed_user_codec_arc)]
1058 #[expr($;self)]
1059 fn with_distributed_user_codec_arc(mut self, codec: Arc<dyn PhysicalExtensionCodec>) -> Self;
1060
1061 fn set_distributed_worker_resolver<T: WorkerResolver + 'static>(&mut self, resolver: T);
1062 #[call(set_distributed_worker_resolver)]
1063 #[expr($;self)]
1064 fn with_distributed_worker_resolver<T: WorkerResolver + 'static>(mut self, resolver: T) -> Self;
1065
1066 fn set_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(&mut self, resolver: T);
1067 #[call(set_distributed_channel_resolver)]
1068 #[expr($;self)]
1069 fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(mut self, resolver: T) -> Self;
1070
1071 fn set_distributed_file_scan_config_bytes_per_partition(&mut self, bytes_per_partition: usize) -> Result<(), DataFusionError>;
1072 #[call(set_distributed_file_scan_config_bytes_per_partition)]
1073 #[expr($?;Ok(self))]
1074 fn with_distributed_file_scan_config_bytes_per_partition(mut self, bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1075
1076 fn set_distributed_cardinality_effect_task_scale_factor(&mut self, factor: f64) -> Result<(), DataFusionError>;
1077 #[call(set_distributed_cardinality_effect_task_scale_factor)]
1078 #[expr($?;Ok(self))]
1079 fn with_distributed_cardinality_effect_task_scale_factor(mut self, factor: f64) -> Result<Self, DataFusionError>;
1080
1081 fn set_distributed_metrics_collection(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1082 #[call(set_distributed_metrics_collection)]
1083 #[expr($?;Ok(self))]
1084 fn with_distributed_metrics_collection(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1085
1086 fn set_distributed_children_isolator_unions(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1087 #[call(set_distributed_children_isolator_unions)]
1088 #[expr($?;Ok(self))]
1089 fn with_distributed_children_isolator_unions(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1090
1091 fn set_distributed_broadcast_joins(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1092 #[call(set_distributed_broadcast_joins)]
1093 #[expr($?;Ok(self))]
1094 fn with_distributed_broadcast_joins(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1095
1096 #[cfg(feature = "grpc")]
1097 fn set_distributed_compression(&mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<(), DataFusionError>;
1098 #[call(set_distributed_compression)]
1099 #[expr($?;Ok(self))]
1100 #[cfg(feature = "grpc")]
1101 fn with_distributed_compression(mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<Self, DataFusionError>;
1102
1103 fn set_distributed_shuffle_batch_size(&mut self, batch_size: usize) -> Result<(), DataFusionError>;
1104 #[call(set_distributed_shuffle_batch_size)]
1105 #[expr($?;Ok(self))]
1106 fn with_distributed_shuffle_batch_size(mut self, batch_size: usize) -> Result<Self, DataFusionError>;
1107
1108 fn set_distributed_passthrough_headers(&mut self, headers: HeaderMap) -> Result<(), DataFusionError>;
1109 #[call(set_distributed_passthrough_headers)]
1110 #[expr($?;Ok(self))]
1111 fn with_distributed_passthrough_headers(mut self, headers: HeaderMap) -> Result<Self, DataFusionError>;
1112
1113 fn set_distributed_max_tasks_per_stage(&mut self, max_tasks_per_stage: usize) -> Result<(), DataFusionError>;
1114 #[call(set_distributed_max_tasks_per_stage)]
1115 #[expr($?;Ok(self))]
1116 fn with_distributed_max_tasks_per_stage(mut self, max_tasks_per_stage: usize) -> Result<Self, DataFusionError>;
1117
1118 fn set_distributed_partial_reduce(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1119 #[call(set_distributed_partial_reduce)]
1120 #[expr($?;Ok(self))]
1121 fn with_distributed_partial_reduce(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1122
1123 fn set_distributed_worker_connection_buffer_budget_bytes(&mut self, budget_bytes: usize) -> Result<(), DataFusionError>;
1124 #[call(set_distributed_worker_connection_buffer_budget_bytes)]
1125 #[expr($?;Ok(self))]
1126 fn with_distributed_worker_connection_buffer_budget_bytes(mut self, budget_bytes: usize) -> Result<Self, DataFusionError>;
1127
1128 fn set_distributed_work_unit_feed<T, P, F>(&mut self, getter: F)
1129 where
1130 T: ExecutionPlan + 'static,
1131 P: WorkUnitFeedProvider + 'static,
1132 P::WorkUnit: 'static,
1133 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1134 #[call(set_distributed_work_unit_feed)]
1135 #[expr($;self)]
1136 fn with_distributed_work_unit_feed<T, P, F>(mut self, getter: F) -> Self
1137 where
1138 T: ExecutionPlan + 'static,
1139 P: WorkUnitFeedProvider + 'static,
1140 P::WorkUnit: 'static,
1141 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1142
1143 fn set_distributed_dynamic_task_count(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1144 #[call(set_distributed_dynamic_task_count)]
1145 #[expr($?;Ok(self))]
1146 fn with_distributed_dynamic_task_count(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1147
1148 fn set_distributed_dynamic_bytes_per_partition(&mut self, dynamic_bytes_per_partition: usize) -> Result<(), DataFusionError>;
1149 #[call(set_distributed_dynamic_bytes_per_partition)]
1150 #[expr($?;Ok(self))]
1151 fn with_distributed_dynamic_bytes_per_partition(mut self, dynamic_bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1152
1153 fn set_distributed_local_worker_context(&mut self, local_worker_context: LocalWorkerContext);
1154 #[call(set_distributed_local_worker_context)]
1155 #[expr($;self)]
1156 fn with_distributed_local_worker_context(mut self, local_worker_context: LocalWorkerContext) -> Self;
1157
1158 fn set_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(&mut self, h: H);
1159 #[call(set_distributed_desired_task_count_handler)]
1160 #[expr($;self)]
1161 fn with_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(mut self, h: H) -> Self;
1162
1163 fn set_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(&mut self, h: H);
1164 #[call(set_distributed_scale_up_leaf_node_handler)]
1165 #[expr($;self)]
1166 fn with_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(mut self, h: H) -> Self;
1167
1168 fn set_distributed_route_tasks_handler<H: RouteTasksHandler>(&mut self, h: H);
1169 #[call(set_distributed_route_tasks_handler)]
1170 #[expr($;self)]
1171 fn with_distributed_route_tasks_handler<H: RouteTasksHandler>(mut self, h: H) -> Self;
1172
1173 fn set_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(&mut self, h: H);
1174 #[call(set_distributed_worker_plan_rewrite_handler)]
1175 #[expr($;self)]
1176 fn with_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(mut self, h: H) -> Self;
1177 }
1178 }
1179}
1180impl DistributedGetterExt for SessionState {
1181 delegate! {
1182 to self.config() {
1183 fn get_distributed_worker_resolver(&self) -> Result<Arc<dyn WorkerResolver>, DataFusionError>;
1184 }
1185 }
1186}
1187
1188impl DistributedExt for SessionState {
1189 delegate! {
1190 to self.config_mut() {
1191 fn set_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T);
1192 #[call(set_distributed_option_extension)]
1193 #[expr($;self)]
1194 fn with_distributed_option_extension<T: ConfigExtension + Default>(mut self, t: T) -> Self;
1195
1196 fn set_distributed_option_extension_from_headers<T: ConfigExtension + Default>(&mut self, h: &HeaderMap) -> Result<(), DataFusionError>;
1197 #[call(set_distributed_option_extension_from_headers)]
1198 #[expr($?;Ok(self))]
1199 fn with_distributed_option_extension_from_headers<T: ConfigExtension + Default>(mut self, headers: &HeaderMap) -> Result<Self, DataFusionError>;
1200
1201 fn set_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(&mut self, codec: T);
1202 #[call(set_distributed_user_codec)]
1203 #[expr($;self)]
1204 fn with_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(mut self, codec: T) -> Self;
1205
1206 fn set_distributed_user_codec_arc(&mut self, codec: Arc<dyn PhysicalExtensionCodec>);
1207 #[call(set_distributed_user_codec_arc)]
1208 #[expr($;self)]
1209 fn with_distributed_user_codec_arc(mut self, codec: Arc<dyn PhysicalExtensionCodec>) -> Self;
1210
1211 fn set_distributed_worker_resolver<T: WorkerResolver + 'static>(&mut self, resolver: T);
1212 #[call(set_distributed_worker_resolver)]
1213 #[expr($;self)]
1214 fn with_distributed_worker_resolver<T: WorkerResolver + 'static>(mut self, resolver: T) -> Self;
1215
1216 fn set_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(&mut self, resolver: T);
1217 #[call(set_distributed_channel_resolver)]
1218 #[expr($;self)]
1219 fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(mut self, resolver: T) -> Self;
1220
1221 fn set_distributed_file_scan_config_bytes_per_partition(&mut self, bytes_per_partition: usize) -> Result<(), DataFusionError>;
1222 #[call(set_distributed_file_scan_config_bytes_per_partition)]
1223 #[expr($?;Ok(self))]
1224 fn with_distributed_file_scan_config_bytes_per_partition(mut self, bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1225
1226 fn set_distributed_cardinality_effect_task_scale_factor(&mut self, factor: f64) -> Result<(), DataFusionError>;
1227 #[call(set_distributed_cardinality_effect_task_scale_factor)]
1228 #[expr($?;Ok(self))]
1229 fn with_distributed_cardinality_effect_task_scale_factor(mut self, factor: f64) -> Result<Self, DataFusionError>;
1230
1231 fn set_distributed_metrics_collection(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1232 #[call(set_distributed_metrics_collection)]
1233 #[expr($?;Ok(self))]
1234 fn with_distributed_metrics_collection(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1235
1236 fn set_distributed_children_isolator_unions(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1237 #[call(set_distributed_children_isolator_unions)]
1238 #[expr($?;Ok(self))]
1239 fn with_distributed_children_isolator_unions(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1240
1241 fn set_distributed_broadcast_joins(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1242 #[call(set_distributed_broadcast_joins)]
1243 #[expr($?;Ok(self))]
1244 fn with_distributed_broadcast_joins(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1245
1246 #[cfg(feature = "grpc")]
1247 fn set_distributed_compression(&mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<(), DataFusionError>;
1248 #[call(set_distributed_compression)]
1249 #[expr($?;Ok(self))]
1250 #[cfg(feature = "grpc")]
1251 fn with_distributed_compression(mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<Self, DataFusionError>;
1252
1253 fn set_distributed_shuffle_batch_size(&mut self, batch_size: usize) -> Result<(), DataFusionError>;
1254 #[call(set_distributed_shuffle_batch_size)]
1255 #[expr($?;Ok(self))]
1256 fn with_distributed_shuffle_batch_size(mut self, batch_size: usize) -> Result<Self, DataFusionError>;
1257
1258 fn set_distributed_passthrough_headers(&mut self, headers: HeaderMap) -> Result<(), DataFusionError>;
1259 #[call(set_distributed_passthrough_headers)]
1260 #[expr($?;Ok(self))]
1261 fn with_distributed_passthrough_headers(mut self, headers: HeaderMap) -> Result<Self, DataFusionError>;
1262
1263 fn set_distributed_max_tasks_per_stage(&mut self, max_tasks_per_stage: usize) -> Result<(), DataFusionError>;
1264 #[call(set_distributed_max_tasks_per_stage)]
1265 #[expr($?;Ok(self))]
1266 fn with_distributed_max_tasks_per_stage(mut self, max_tasks_per_stage: usize) -> Result<Self, DataFusionError>;
1267
1268 fn set_distributed_partial_reduce(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1269 #[call(set_distributed_partial_reduce)]
1270 #[expr($?;Ok(self))]
1271 fn with_distributed_partial_reduce(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1272
1273 fn set_distributed_worker_connection_buffer_budget_bytes(&mut self, budget_bytes: usize) -> Result<(), DataFusionError>;
1274 #[call(set_distributed_worker_connection_buffer_budget_bytes)]
1275 #[expr($?;Ok(self))]
1276 fn with_distributed_worker_connection_buffer_budget_bytes(mut self, budget_bytes: usize) -> Result<Self, DataFusionError>;
1277
1278 fn set_distributed_work_unit_feed<T, P, F>(&mut self, getter: F)
1279 where
1280 T: ExecutionPlan + 'static,
1281 P: WorkUnitFeedProvider + 'static,
1282 P::WorkUnit: 'static,
1283 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1284 #[call(set_distributed_work_unit_feed)]
1285 #[expr($;self)]
1286 fn with_distributed_work_unit_feed<T, P, F>(mut self, getter: F) -> Self
1287 where
1288 T: ExecutionPlan + 'static,
1289 P: WorkUnitFeedProvider + 'static,
1290 P::WorkUnit: 'static,
1291 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1292
1293 fn set_distributed_dynamic_task_count(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1294 #[call(set_distributed_dynamic_task_count)]
1295 #[expr($?;Ok(self))]
1296 fn with_distributed_dynamic_task_count(mut self, enabled: bool) -> Result<Self, DataFusionError>;
1297
1298 fn set_distributed_dynamic_bytes_per_partition(&mut self, dynamic_bytes_per_partition: usize) -> Result<(), DataFusionError>;
1299 #[call(set_distributed_dynamic_bytes_per_partition)]
1300 #[expr($?;Ok(self))]
1301 fn with_distributed_dynamic_bytes_per_partition(mut self, dynamic_bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1302
1303 fn set_distributed_local_worker_context(&mut self, local_worker_context: LocalWorkerContext);
1304 #[call(set_distributed_local_worker_context)]
1305 #[expr($;self)]
1306 fn with_distributed_local_worker_context(mut self, local_worker_context: LocalWorkerContext) -> Self;
1307
1308 fn set_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(&mut self, h: H);
1309 #[call(set_distributed_desired_task_count_handler)]
1310 #[expr($;self)]
1311 fn with_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(mut self, h: H) -> Self;
1312
1313 fn set_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(&mut self, h: H);
1314 #[call(set_distributed_scale_up_leaf_node_handler)]
1315 #[expr($;self)]
1316 fn with_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(mut self, h: H) -> Self;
1317
1318 fn set_distributed_route_tasks_handler<H: RouteTasksHandler>(&mut self, h: H);
1319 #[call(set_distributed_route_tasks_handler)]
1320 #[expr($;self)]
1321 fn with_distributed_route_tasks_handler<H: RouteTasksHandler>(mut self, h: H) -> Self;
1322
1323 fn set_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(&mut self, h: H);
1324 #[call(set_distributed_worker_plan_rewrite_handler)]
1325 #[expr($;self)]
1326 fn with_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(mut self, h: H) -> Self;
1327 }
1328 }
1329}
1330
1331impl DistributedExt for SessionContext {
1332 delegate! {
1333 to self.state_ref().write().config_mut() {
1334 fn set_distributed_option_extension<T: ConfigExtension + Default>(&mut self, t: T);
1335 #[call(set_distributed_option_extension)]
1336 #[expr($;self)]
1337 fn with_distributed_option_extension<T: ConfigExtension + Default>(self, t: T) -> Self;
1338
1339 fn set_distributed_option_extension_from_headers<T: ConfigExtension + Default>(&mut self, h: &HeaderMap) -> Result<(), DataFusionError>;
1340 #[call(set_distributed_option_extension_from_headers)]
1341 #[expr($?;Ok(self))]
1342 fn with_distributed_option_extension_from_headers<T: ConfigExtension + Default>(self, headers: &HeaderMap) -> Result<Self, DataFusionError>;
1343
1344 fn set_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(&mut self, codec: T);
1345 #[call(set_distributed_user_codec)]
1346 #[expr($;self)]
1347 fn with_distributed_user_codec<T: PhysicalExtensionCodec + 'static>(self, codec: T) -> Self;
1348
1349 fn set_distributed_user_codec_arc(&mut self, codec: Arc<dyn PhysicalExtensionCodec>);
1350 #[call(set_distributed_user_codec_arc)]
1351 #[expr($;self)]
1352 fn with_distributed_user_codec_arc(self, codec: Arc<dyn PhysicalExtensionCodec>) -> Self;
1353
1354 fn set_distributed_worker_resolver<T: WorkerResolver + 'static>(&mut self, resolver: T);
1355 #[call(set_distributed_worker_resolver)]
1356 #[expr($;self)]
1357 fn with_distributed_worker_resolver<T: WorkerResolver + 'static>(self, resolver: T) -> Self;
1358
1359 fn set_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(&mut self, resolver: T);
1360 #[call(set_distributed_channel_resolver)]
1361 #[expr($;self)]
1362 fn with_distributed_channel_resolver<T: ChannelResolver + Send + Sync + 'static>(self, resolver: T) -> Self;
1363
1364 fn set_distributed_file_scan_config_bytes_per_partition(&mut self, bytes_per_partition: usize) -> Result<(), DataFusionError>;
1365 #[call(set_distributed_file_scan_config_bytes_per_partition)]
1366 #[expr($?;Ok(self))]
1367 fn with_distributed_file_scan_config_bytes_per_partition(self, bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1368
1369 fn set_distributed_cardinality_effect_task_scale_factor(&mut self, factor: f64) -> Result<(), DataFusionError>;
1370 #[call(set_distributed_cardinality_effect_task_scale_factor)]
1371 #[expr($?;Ok(self))]
1372 fn with_distributed_cardinality_effect_task_scale_factor(self, factor: f64) -> Result<Self, DataFusionError>;
1373
1374 fn set_distributed_metrics_collection(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1375 #[call(set_distributed_metrics_collection)]
1376 #[expr($?;Ok(self))]
1377 fn with_distributed_metrics_collection(self, enabled: bool) -> Result<Self, DataFusionError>;
1378
1379 fn set_distributed_children_isolator_unions(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1380 #[call(set_distributed_children_isolator_unions)]
1381 #[expr($?;Ok(self))]
1382 fn with_distributed_children_isolator_unions(self, enabled: bool) -> Result<Self, DataFusionError>;
1383
1384 fn set_distributed_broadcast_joins(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1385 #[call(set_distributed_broadcast_joins)]
1386 #[expr($?;Ok(self))]
1387 fn with_distributed_broadcast_joins(self, enabled: bool) -> Result<Self, DataFusionError>;
1388
1389 #[cfg(feature = "grpc")]
1390 fn set_distributed_compression(&mut self, compression: Option<arrow_ipc::CompressionType>) -> Result<(), DataFusionError>;
1391 #[call(set_distributed_compression)]
1392 #[expr($?;Ok(self))]
1393 #[cfg(feature = "grpc")]
1394 fn with_distributed_compression(self, compression: Option<arrow_ipc::CompressionType>) -> Result<Self, DataFusionError>;
1395
1396 fn set_distributed_shuffle_batch_size(&mut self, batch_size: usize) -> Result<(), DataFusionError>;
1397 #[call(set_distributed_shuffle_batch_size)]
1398 #[expr($?;Ok(self))]
1399 fn with_distributed_shuffle_batch_size(self, batch_size: usize) -> Result<Self, DataFusionError>;
1400
1401 fn set_distributed_passthrough_headers(&mut self, headers: HeaderMap) -> Result<(), DataFusionError>;
1402 #[call(set_distributed_passthrough_headers)]
1403 #[expr($?;Ok(self))]
1404 fn with_distributed_passthrough_headers(self, headers: HeaderMap) -> Result<Self, DataFusionError>;
1405
1406 fn set_distributed_max_tasks_per_stage(&mut self, max_tasks_per_stage: usize) -> Result<(), DataFusionError>;
1407 #[call(set_distributed_max_tasks_per_stage)]
1408 #[expr($?;Ok(self))]
1409 fn with_distributed_max_tasks_per_stage(self, max_tasks_per_stage: usize) -> Result<Self, DataFusionError>;
1410
1411 fn set_distributed_partial_reduce(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1412 #[call(set_distributed_partial_reduce)]
1413 #[expr($?;Ok(self))]
1414 fn with_distributed_partial_reduce(self, enabled: bool) -> Result<Self, DataFusionError>;
1415
1416 fn set_distributed_worker_connection_buffer_budget_bytes(&mut self, budget_bytes: usize) -> Result<(), DataFusionError>;
1417 #[call(set_distributed_worker_connection_buffer_budget_bytes)]
1418 #[expr($?;Ok(self))]
1419 fn with_distributed_worker_connection_buffer_budget_bytes(self, budget_bytes: usize) -> Result<Self, DataFusionError>;
1420
1421 fn set_distributed_work_unit_feed<T, P, F>(&mut self, getter: F)
1422 where
1423 T: ExecutionPlan + 'static,
1424 P: WorkUnitFeedProvider + 'static,
1425 P::WorkUnit: 'static,
1426 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1427 #[call(set_distributed_work_unit_feed)]
1428 #[expr($;self)]
1429 fn with_distributed_work_unit_feed<T, P, F>(self, getter: F) -> Self
1430 where
1431 T: ExecutionPlan + 'static,
1432 P: WorkUnitFeedProvider + 'static,
1433 P::WorkUnit: 'static,
1434 F: Fn(&T) -> Option<&WorkUnitFeed<P>> + Send + Sync + 'static;
1435
1436 fn set_distributed_dynamic_task_count(&mut self, enabled: bool) -> Result<(), DataFusionError>;
1437 #[call(set_distributed_dynamic_task_count)]
1438 #[expr($?;Ok(self))]
1439 fn with_distributed_dynamic_task_count(self, enabled: bool) -> Result<Self, DataFusionError>;
1440
1441 fn set_distributed_dynamic_bytes_per_partition(&mut self, dynamic_bytes_per_partition: usize) -> Result<(), DataFusionError>;
1442 #[call(set_distributed_dynamic_bytes_per_partition)]
1443 #[expr($?;Ok(self))]
1444 fn with_distributed_dynamic_bytes_per_partition(self, dynamic_bytes_per_partition: usize) -> Result<Self, DataFusionError>;
1445
1446 fn set_distributed_local_worker_context(&mut self, local_worker_context: LocalWorkerContext);
1447 #[call(set_distributed_local_worker_context)]
1448 #[expr($;self)]
1449 fn with_distributed_local_worker_context(self, local_worker_context: LocalWorkerContext) -> Self;
1450
1451 fn set_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(&mut self, h: H);
1452 #[call(set_distributed_desired_task_count_handler)]
1453 #[expr($;self)]
1454 fn with_distributed_desired_task_count_handler<H: DesiredTaskCountHandler>(self, h: H) -> Self;
1455
1456 fn set_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(&mut self, h: H);
1457 #[call(set_distributed_scale_up_leaf_node_handler)]
1458 #[expr($;self)]
1459 fn with_distributed_scale_up_leaf_node_handler<H: ScaleUpLeafNodeHandler>(self, h: H) -> Self;
1460
1461 fn set_distributed_route_tasks_handler<H: RouteTasksHandler>(&mut self, h: H);
1462 #[call(set_distributed_route_tasks_handler)]
1463 #[expr($;self)]
1464 fn with_distributed_route_tasks_handler<H: RouteTasksHandler>(self, h: H) -> Self;
1465
1466 fn set_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(&mut self, h: H);
1467 #[call(set_distributed_worker_plan_rewrite_handler)]
1468 #[expr($;self)]
1469 fn with_distributed_worker_plan_rewrite_handler<H: WorkerPlanRewriteHandler>(self, h: H) -> Self;
1470 }
1471 }
1472}
1473
1474impl DistributedGetterExt for SessionContext {
1475 delegate! {
1476 to self.state_ref().read().config() {
1477 fn get_distributed_worker_resolver(&self) -> Result<Arc<dyn WorkerResolver>, DataFusionError>;
1478 }
1479 }
1480}