@@ -31,7 +31,7 @@ use stackable_operator::{
3131 self ,
3232 spec:: { ContainerLogConfig , Logging } ,
3333 } ,
34- role_utils:: { self , GenericRoleConfig , Role , RoleGroupRef } ,
34+ role_utils:: { self , GenericRoleConfig , Role } ,
3535 schemars:: { self , JsonSchema } ,
3636 shared:: time:: Duration ,
3737 status:: condition:: { ClusterCondition , HasStatusCondition } ,
@@ -264,71 +264,6 @@ impl v1alpha1::HdfsCluster {
264264 }
265265 }
266266
267- pub fn rolegroup_ref (
268- & self ,
269- role_name : impl Into < String > ,
270- group_name : impl Into < String > ,
271- ) -> RoleGroupRef < v1alpha1:: HdfsCluster > {
272- RoleGroupRef {
273- cluster : ObjectRef :: from_obj ( self ) ,
274- role : role_name. into ( ) ,
275- role_group : group_name. into ( ) ,
276- }
277- }
278-
279- pub fn rolegroup_ref_and_replicas (
280- & self ,
281- role : & HdfsNodeRole ,
282- ) -> Vec < ( RoleGroupRef < v1alpha1:: HdfsCluster > , u16 ) > {
283- match role {
284- HdfsNodeRole :: Name => self
285- . spec
286- . name_nodes
287- . iter ( )
288- . flat_map ( |role| & role. role_groups )
289- // Order rolegroups consistently, to avoid spurious downstream rewrites
290- . collect :: < BTreeMap < _ , _ > > ( )
291- . into_iter ( )
292- . map ( |( rolegroup_name, role_group) | {
293- (
294- self . rolegroup_ref ( HdfsNodeRole :: Name . to_string ( ) , rolegroup_name) ,
295- role_group. replicas . unwrap_or_default ( ) ,
296- )
297- } )
298- . collect ( ) ,
299- HdfsNodeRole :: Data => self
300- . spec
301- . data_nodes
302- . iter ( )
303- . flat_map ( |role| & role. role_groups )
304- // Order rolegroups consistently, to avoid spurious downstream rewrites
305- . collect :: < BTreeMap < _ , _ > > ( )
306- . into_iter ( )
307- . map ( |( rolegroup_name, role_group) | {
308- (
309- self . rolegroup_ref ( HdfsNodeRole :: Data . to_string ( ) , rolegroup_name) ,
310- role_group. replicas . unwrap_or_default ( ) ,
311- )
312- } )
313- . collect ( ) ,
314- HdfsNodeRole :: Journal => self
315- . spec
316- . journal_nodes
317- . iter ( )
318- . flat_map ( |role| & role. role_groups )
319- // Order rolegroups consistently, to avoid spurious downstream rewrites
320- . collect :: < BTreeMap < _ , _ > > ( )
321- . into_iter ( )
322- . map ( |( rolegroup_name, role_group) | {
323- (
324- self . rolegroup_ref ( HdfsNodeRole :: Journal . to_string ( ) , rolegroup_name) ,
325- role_group. replicas . unwrap_or_default ( ) ,
326- )
327- } )
328- . collect ( ) ,
329- }
330- }
331-
332267 pub fn upgrade_state ( & self ) -> Result < Option < UpgradeState > , UpgradeStateError > {
333268 use upgrade_state_error:: * ;
334269 let Some ( status) = self . status . as_ref ( ) else {
0 commit comments