1- //! Ensures that `Pod`s are configured and running for each [`HiveCluster`]
1+ //! Ensures that `Pod`s are configured and running for each [`v1alpha1::HiveCluster`]
2+
23use std:: {
34 borrow:: Cow ,
45 collections:: { BTreeMap , HashMap } ,
@@ -15,14 +16,6 @@ use product_config::{
1516 ProductConfigManager ,
1617} ;
1718use snafu:: { OptionExt , ResultExt , Snafu } ;
18- use stackable_hive_crd:: {
19- Container , HiveCluster , HiveClusterStatus , HiveRole , MetaStoreConfig , APP_NAME , CORE_SITE_XML ,
20- DB_PASSWORD_ENV , DB_USERNAME_ENV , HADOOP_HEAPSIZE , HIVE_ENV_SH , HIVE_PORT , HIVE_PORT_NAME ,
21- HIVE_SITE_XML , JVM_HEAP_FACTOR , JVM_SECURITY_PROPERTIES_FILE , METRICS_PORT , METRICS_PORT_NAME ,
22- STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME , STACKABLE_CONFIG_MOUNT_DIR ,
23- STACKABLE_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_CONFIG_MOUNT_DIR ,
24- STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR , STACKABLE_LOG_DIR_NAME ,
25- } ;
2619use stackable_operator:: {
2720 builder:: {
2821 self ,
@@ -86,6 +79,15 @@ use tracing::warn;
8679
8780use crate :: {
8881 command:: build_container_command_args,
82+ crd:: {
83+ v1alpha1, Container , HiveClusterStatus , HiveRole , MetaStoreConfig , APP_NAME , CORE_SITE_XML ,
84+ DB_PASSWORD_ENV , DB_USERNAME_ENV , HADOOP_HEAPSIZE , HIVE_ENV_SH , HIVE_PORT , HIVE_PORT_NAME ,
85+ HIVE_SITE_XML , JVM_HEAP_FACTOR , JVM_SECURITY_PROPERTIES_FILE , METRICS_PORT ,
86+ METRICS_PORT_NAME , STACKABLE_CONFIG_DIR , STACKABLE_CONFIG_DIR_NAME ,
87+ STACKABLE_CONFIG_MOUNT_DIR , STACKABLE_CONFIG_MOUNT_DIR_NAME ,
88+ STACKABLE_LOG_CONFIG_MOUNT_DIR , STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME , STACKABLE_LOG_DIR ,
89+ STACKABLE_LOG_DIR_NAME ,
90+ } ,
8991 discovery,
9092 kerberos:: {
9193 self , add_kerberos_pod_config, kerberos_config_properties,
@@ -128,7 +130,7 @@ pub enum Error {
128130
129131 #[ snafu( display( "failed to calculate service name for role {rolegroup}" ) ) ]
130132 RoleGroupServiceNameNotFound {
131- rolegroup : RoleGroupRef < HiveCluster > ,
133+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
132134 } ,
133135
134136 #[ snafu( display( "failed to apply global Service" ) ) ]
@@ -139,25 +141,25 @@ pub enum Error {
139141 #[ snafu( display( "failed to apply Service for {rolegroup}" ) ) ]
140142 ApplyRoleGroupService {
141143 source : stackable_operator:: cluster_resources:: Error ,
142- rolegroup : RoleGroupRef < HiveCluster > ,
144+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
143145 } ,
144146
145147 #[ snafu( display( "failed to build ConfigMap for {rolegroup}" ) ) ]
146148 BuildRoleGroupConfig {
147149 source : stackable_operator:: builder:: configmap:: Error ,
148- rolegroup : RoleGroupRef < HiveCluster > ,
150+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
149151 } ,
150152
151153 #[ snafu( display( "failed to apply ConfigMap for {rolegroup}" ) ) ]
152154 ApplyRoleGroupConfig {
153155 source : stackable_operator:: cluster_resources:: Error ,
154- rolegroup : RoleGroupRef < HiveCluster > ,
156+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
155157 } ,
156158
157159 #[ snafu( display( "failed to apply StatefulSet for {rolegroup}" ) ) ]
158160 ApplyRoleGroupStatefulSet {
159161 source : stackable_operator:: cluster_resources:: Error ,
160- rolegroup : RoleGroupRef < HiveCluster > ,
162+ rolegroup : RoleGroupRef < v1alpha1 :: HiveCluster > ,
161163 } ,
162164
163165 #[ snafu( display( "failed to generate product config" ) ) ]
@@ -200,7 +202,7 @@ pub enum Error {
200202 S3TlsNoVerificationNotSupported ,
201203
202204 #[ snafu( display( "failed to resolve and merge resource config for role and role group" ) ) ]
203- FailedToResolveResourceConfig { source : stackable_hive_crd :: Error } ,
205+ FailedToResolveResourceConfig { source : crate :: crd :: Error } ,
204206
205207 #[ snafu( display( "invalid java heap config - missing default or value in crd?" ) ) ]
206208 InvalidJavaHeapConfig ,
@@ -254,7 +256,7 @@ pub enum Error {
254256 } ,
255257
256258 #[ snafu( display( "internal operator failure" ) ) ]
257- InternalOperatorError { source : stackable_hive_crd :: Error } ,
259+ InternalOperatorError { source : crate :: crd :: Error } ,
258260
259261 #[ snafu( display(
260262 "failed to serialize [{JVM_SECURITY_PROPERTIES_FILE}] for {}" ,
@@ -336,7 +338,7 @@ impl ReconcilerError for Error {
336338}
337339
338340pub async fn reconcile_hive (
339- hive : Arc < DeserializeGuard < HiveCluster > > ,
341+ hive : Arc < DeserializeGuard < v1alpha1 :: HiveCluster > > ,
340342 ctx : Arc < Ctx > ,
341343) -> Result < Action > {
342344 tracing:: info!( "Starting reconcile" ) ;
@@ -554,7 +556,7 @@ pub async fn reconcile_hive(
554556/// The server-role service is the primary endpoint that should be used by clients that do not
555557/// perform internal load balancing including targets outside of the cluster.
556558pub fn build_metastore_role_service (
557- hive : & HiveCluster ,
559+ hive : & v1alpha1 :: HiveCluster ,
558560 resolved_product_image : & ResolvedProductImage ,
559561) -> Result < Service > {
560562 let role_name = HiveRole :: MetaStore . to_string ( ) ;
@@ -593,10 +595,10 @@ pub fn build_metastore_role_service(
593595/// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator
594596#[ allow( clippy:: too_many_arguments) ]
595597fn build_metastore_rolegroup_config_map (
596- hive : & HiveCluster ,
598+ hive : & v1alpha1 :: HiveCluster ,
597599 hive_namespace : & str ,
598600 resolved_product_image : & ResolvedProductImage ,
599- rolegroup : & RoleGroupRef < HiveCluster > ,
601+ rolegroup : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
600602 role_group_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
601603 s3_connection_spec : Option < & S3ConnectionSpec > ,
602604 merged_config : & MetaStoreConfig ,
@@ -766,9 +768,9 @@ fn build_metastore_rolegroup_config_map(
766768///
767769/// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
768770fn build_rolegroup_service (
769- hive : & HiveCluster ,
771+ hive : & v1alpha1 :: HiveCluster ,
770772 resolved_product_image : & ResolvedProductImage ,
771- rolegroup : & RoleGroupRef < HiveCluster > ,
773+ rolegroup : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
772774) -> Result < Service > {
773775 Ok ( Service {
774776 metadata : ObjectMetaBuilder :: new ( )
@@ -808,10 +810,10 @@ fn build_rolegroup_service(
808810/// corresponding [`Service`] (from [`build_rolegroup_service`]).
809811#[ allow( clippy:: too_many_arguments) ]
810812fn build_metastore_rolegroup_statefulset (
811- hive : & HiveCluster ,
813+ hive : & v1alpha1 :: HiveCluster ,
812814 hive_role : & HiveRole ,
813815 resolved_product_image : & ResolvedProductImage ,
814- rolegroup_ref : & RoleGroupRef < HiveCluster > ,
816+ rolegroup_ref : & RoleGroupRef < v1alpha1 :: HiveCluster > ,
815817 metastore_config : & HashMap < PropertyNameKind , BTreeMap < String , String > > ,
816818 s3_connection : Option < & S3ConnectionSpec > ,
817819 merged_config : & MetaStoreConfig ,
@@ -1143,7 +1145,7 @@ fn env_var_from_secret(var_name: &str, secret: &str, secret_key: &str) -> EnvVar
11431145}
11441146
11451147pub fn error_policy (
1146- _obj : Arc < DeserializeGuard < HiveCluster > > ,
1148+ _obj : Arc < DeserializeGuard < v1alpha1 :: HiveCluster > > ,
11471149 error : & Error ,
11481150 _ctx : Arc < Ctx > ,
11491151) -> Action {
0 commit comments