11use std:: { collections:: BTreeMap , str:: FromStr } ;
22
3+ use databases:: MetadataDatabaseConnection ;
34use security:: AuthenticationConfig ;
45use serde:: { Deserialize , Serialize } ;
56use snafu:: { OptionExt , ResultExt , Snafu } ;
@@ -19,12 +20,6 @@ use stackable_operator::{
1920 merge:: Merge ,
2021 } ,
2122 crd:: s3,
22- databases:: {
23- databases:: {
24- derby:: DerbyConnection , mysql:: MysqlConnection , postgresql:: PostgresqlConnection ,
25- } ,
26- drivers:: jdbc:: JDBCDatabaseConnection ,
27- } ,
2823 deep_merger:: ObjectOverrides ,
2924 k8s_openapi:: apimachinery:: pkg:: api:: resource:: Quantity ,
3025 kube:: { CustomResource , ResourceExt , runtime:: reflector:: ObjectRef } ,
@@ -43,6 +38,7 @@ use v1alpha1::HiveMetastoreRoleConfig;
4338use crate :: { crd:: affinity:: get_affinity, listener:: metastore_default_listener_class} ;
4439
4540pub mod affinity;
41+ pub mod databases;
4642pub mod security;
4743
4844pub const FIELD_MANAGER : & str = "hive-operator" ;
@@ -497,45 +493,6 @@ impl MetaStoreConfig {
497493 }
498494}
499495
500- #[ derive( Clone , Debug , Deserialize , JsonSchema , PartialEq , Serialize ) ]
501- #[ serde( rename_all = "camelCase" ) ]
502- pub enum MetadataDatabaseConnection {
503- /// TODO docs
504- Postgresql ( PostgresqlConnection ) ,
505-
506- /// TODO docs
507- ///
508- /// Please note that - due to license issues - we don't ship the mysql driver, you need to add
509- /// it it yourself.
510- /// See <https://docs.stackable.tech/home/stable/hive/usage-guide/database-driver/> for details.
511- Mysql ( MysqlConnection ) ,
512-
513- /// TODO docs
514- Derby ( DerbyConnection ) ,
515- // We don't support generic (yet?), as we need to tell the metastore the `--dbtype` on startup,
516- // which is not known for generic connection.
517- // Generic(GenericJDBCDatabaseConnection),
518- }
519-
520- impl MetadataDatabaseConnection {
521- pub fn as_jdbc_database_connection ( & self ) -> & dyn JDBCDatabaseConnection {
522- match self {
523- Self :: Postgresql ( p) => p,
524- Self :: Mysql ( m) => m,
525- Self :: Derby ( d) => d,
526- }
527- }
528-
529- /// Name of the database as it should be passed using the `--db-type` CLI argument to Hive
530- pub fn as_hive_db_type ( & self ) -> & str {
531- match self {
532- MetadataDatabaseConnection :: Postgresql ( _) => "postgres" ,
533- MetadataDatabaseConnection :: Mysql ( _) => "mysql" ,
534- MetadataDatabaseConnection :: Derby ( _) => "derby" ,
535- }
536- }
537- }
538-
539496impl Configuration for MetaStoreConfigFragment {
540497 type Configurable = v1alpha1:: HiveCluster ;
541498
0 commit comments