|
5 | 5 | //! |
6 | 6 | //! Based on the Trino documentation: <https://trino.io/docs/current/admin/fault-tolerant-execution.html> |
7 | 7 |
|
8 | | -use std::collections::{BTreeMap, HashMap}; |
| 8 | +use std::collections::BTreeMap; |
9 | 9 |
|
10 | 10 | use serde::{Deserialize, Serialize}; |
11 | 11 | use snafu::Snafu; |
@@ -124,10 +124,6 @@ pub struct ExchangeManagerConfig { |
124 | 124 | /// Backend-specific configuration. |
125 | 125 | #[serde(flatten)] |
126 | 126 | pub backend: ExchangeManagerBackend, |
127 | | - |
128 | | - /// The `configOverrides` allow overriding arbitrary exchange manager properties. |
129 | | - #[serde(default)] |
130 | | - pub config_overrides: HashMap<String, String>, |
131 | 127 | } |
132 | 128 |
|
133 | 129 | #[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] |
@@ -440,8 +436,6 @@ impl ResolvedFaultTolerantExecutionConfig { |
440 | 436 | ); |
441 | 437 | } |
442 | 438 | } |
443 | | - |
444 | | - exchange_manager_properties.extend(exchange_config.config_overrides.clone()); |
445 | 439 | } |
446 | 440 |
|
447 | 441 | let mut resolved_config = Self { |
@@ -562,6 +556,7 @@ impl ResolvedFaultTolerantExecutionConfig { |
562 | 556 |
|
563 | 557 | #[cfg(test)] |
564 | 558 | mod tests { |
| 559 | + |
565 | 560 | use super::*; |
566 | 561 |
|
567 | 562 | #[tokio::test] |
@@ -625,7 +620,6 @@ mod tests { |
625 | 620 | backend: ExchangeManagerBackend::Local(LocalExchangeConfig { |
626 | 621 | base_directories: vec!["/tmp/exchange".to_string()], |
627 | 622 | }), |
628 | | - config_overrides: HashMap::new(), |
629 | 623 | }), |
630 | 624 | }); |
631 | 625 |
|
@@ -705,7 +699,6 @@ mod tests { |
705 | 699 | max_error_retries: Some(5), |
706 | 700 | upload_part_size: Some(Quantity("10Mi".to_string())), |
707 | 701 | }), |
708 | | - config_overrides: std::collections::HashMap::new(), |
709 | 702 | }, |
710 | 703 | }); |
711 | 704 |
|
@@ -787,59 +780,4 @@ mod tests { |
787 | 780 | Some(&"8".to_string()) |
788 | 781 | ); |
789 | 782 | } |
790 | | - |
791 | | - #[tokio::test] |
792 | | - async fn test_exchange_manager_config_overrides() { |
793 | | - let mut config_overrides = HashMap::new(); |
794 | | - config_overrides.insert("custom.property".to_string(), "custom-value".to_string()); |
795 | | - config_overrides.insert( |
796 | | - "exchange.s3.upload.part-size".to_string(), |
797 | | - "overridden-value".to_string(), |
798 | | - ); |
799 | | - |
800 | | - let config = FaultTolerantExecutionConfig::Task(TaskRetryConfig { |
801 | | - retry_attempts_per_task: Some(2), |
802 | | - retry_initial_delay: None, |
803 | | - retry_max_delay: None, |
804 | | - retry_delay_scale_factor: None, |
805 | | - exchange_deduplication_buffer_size: None, |
806 | | - exchange_manager: ExchangeManagerConfig { |
807 | | - encryption_enabled: None, |
808 | | - sink_buffer_pool_min_size: None, |
809 | | - sink_buffers_per_partition: None, |
810 | | - sink_max_file_size: None, |
811 | | - source_concurrent_readers: None, |
812 | | - backend: ExchangeManagerBackend::S3(S3ExchangeConfig { |
813 | | - base_directories: vec!["s3://my-bucket/exchange".to_string()], |
814 | | - connection: stackable_operator::crd::s3::v1alpha1::InlineConnectionOrReference::Reference( |
815 | | - "test-s3-connection".to_string() |
816 | | - ), |
817 | | - iam_role: None, |
818 | | - external_id: None, |
819 | | - max_error_retries: None, |
820 | | - upload_part_size: Some(Quantity("10Mi".to_string())), |
821 | | - }), |
822 | | - config_overrides, |
823 | | - }, |
824 | | - }); |
825 | | - |
826 | | - let fte_config = |
827 | | - ResolvedFaultTolerantExecutionConfig::from_config(&config, None, "default") |
828 | | - .await |
829 | | - .unwrap(); |
830 | | - |
831 | | - assert_eq!( |
832 | | - fte_config |
833 | | - .exchange_manager_properties |
834 | | - .get("custom.property"), |
835 | | - Some(&"custom-value".to_string()) |
836 | | - ); |
837 | | - |
838 | | - assert_eq!( |
839 | | - fte_config |
840 | | - .exchange_manager_properties |
841 | | - .get("exchange.s3.upload.part-size"), |
842 | | - Some(&"overridden-value".to_string()) |
843 | | - ); |
844 | | - } |
845 | 783 | } |
0 commit comments