-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmod.rs
More file actions
84 lines (71 loc) · 2.33 KB
/
Copy pathmod.rs
File metadata and controls
84 lines (71 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
pub mod black_hole;
pub mod commons;
pub mod config;
pub mod delta_lake;
pub mod generic;
pub mod google_sheet;
pub mod hive;
pub mod iceberg;
pub mod postgresql;
pub mod tpcds;
pub mod tpch;
use async_trait::async_trait;
use snafu::Snafu;
use stackable_operator::{client::Client, v2::types::kubernetes::NamespaceName};
use crate::controller::dereference::TrinoCatalogName;
use self::config::CatalogConfig;
#[derive(Debug, Snafu)]
#[snafu(module)]
pub enum FromTrinoCatalogError {
#[snafu(display("failed to configure S3 connection"))]
ConfigureS3 {
source: stackable_operator::crd::s3::v1alpha1::ConnectionError,
},
#[snafu(display("trino does not support disabling the TLS verification of S3 servers"))]
S3TlsNoVerificationNotSupported,
#[snafu(display("trino 469 and greater require TLS for S3"))]
S3TlsRequired,
#[snafu(display("trino catalog has no name set"))]
InvalidCatalogSpec,
#[snafu(display("failed to resolve [{catalog}] discovery config map [{cm_name}]"))]
FailedToGetDiscoveryConfigMap {
source: stackable_operator::client::Error,
catalog: String,
cm_name: String,
},
#[snafu(display("failed to retrieve [{catalog}] discovery config map [{cm_name}] data field"))]
FailedToGetDiscoveryConfigMapData { catalog: String, cm_name: String },
#[snafu(display(
"failed to retrieve [{catalog}] discovery config map [{cm_name}] data key [{data_key}]"
))]
FailedToGetDiscoveryConfigMapDataKey {
catalog: String,
cm_name: String,
data_key: String,
},
#[snafu(display("failed to get PostgreSQL connection details"))]
GetPostgresConnectionDetails {
source: stackable_operator::database_connections::Error,
},
}
#[async_trait]
pub trait ToCatalogConfig {
async fn to_catalog_config(
&self,
catalog_name: &TrinoCatalogName,
catalog_namespace: &NamespaceName,
client: &Client,
trino_version: u16,
) -> Result<CatalogConfig, FromTrinoCatalogError>;
}
#[async_trait]
pub trait ExtendCatalogConfig {
async fn extend_catalog_config(
&self,
catalog_config: &mut CatalogConfig,
catalog_name: &TrinoCatalogName,
catalog_namespace: &NamespaceName,
client: &Client,
trino_version: u16,
) -> Result<(), FromTrinoCatalogError>;
}