@@ -66,14 +66,20 @@ pub enum Error {
6666#[ serde( rename_all = "camelCase" ) ]
6767pub struct HdfsClusterSpec {
6868 pub image : ProductImage ,
69- pub auto_format_fs : Option < bool > ,
70- pub dfs_replication : Option < u8 > ,
7169 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
7270 pub name_nodes : Option < Role < NameNodeConfigFragment > > ,
7371 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
7472 pub data_nodes : Option < Role < DataNodeConfigFragment > > ,
7573 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
7674 pub journal_nodes : Option < Role < JournalNodeConfigFragment > > ,
75+ pub cluster_config : HdfsClusterConfig ,
76+ }
77+
78+ #[ derive( Clone , Debug , Deserialize , Eq , Hash , JsonSchema , PartialEq , Serialize ) ]
79+ #[ serde( rename_all = "camelCase" ) ]
80+ pub struct HdfsClusterConfig {
81+ pub auto_format_fs : Option < bool > ,
82+ pub dfs_replication : Option < u8 > ,
7783 /// Name of the Vector aggregator discovery ConfigMap.
7884 /// It must contain the key `ADDRESS` with the address of the Vector aggregator.
7985 #[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -798,7 +804,7 @@ impl Configuration for NameNodeConfigFragment {
798804 ) -> Result < BTreeMap < String , Option < String > > , ConfigError > {
799805 let mut config = BTreeMap :: new ( ) ;
800806 if file == HDFS_SITE_XML {
801- if let Some ( replication) = & resource. spec . dfs_replication {
807+ if let Some ( replication) = & resource. spec . cluster_config . dfs_replication {
802808 config. insert ( DFS_REPLICATION . to_string ( ) , Some ( replication. to_string ( ) ) ) ;
803809 }
804810 }
@@ -929,7 +935,7 @@ impl Configuration for DataNodeConfigFragment {
929935 ) -> Result < BTreeMap < String , Option < String > > , ConfigError > {
930936 let mut config = BTreeMap :: new ( ) ;
931937 if file == HDFS_SITE_XML {
932- if let Some ( replication) = & resource. spec . dfs_replication {
938+ if let Some ( replication) = & resource. spec . cluster_config . dfs_replication {
933939 config. insert ( DFS_REPLICATION . to_string ( ) , Some ( replication. to_string ( ) ) ) ;
934940 }
935941 }
@@ -1072,7 +1078,8 @@ spec:
10721078 image:
10731079 productVersion: 3.3.4
10741080 stackableVersion: 0.2.0
1075- zookeeperConfigMapName: hdfs-zk
1081+ clusterConfig:
1082+ zookeeperConfigMapName: hdfs-zk
10761083 dataNodes:
10771084 roleGroups:
10781085 default:
@@ -1110,7 +1117,8 @@ spec:
11101117 image:
11111118 productVersion: 3.3.4
11121119 stackableVersion: 0.2.0
1113- zookeeperConfigMapName: hdfs-zk
1120+ clusterConfig:
1121+ zookeeperConfigMapName: hdfs-zk
11141122 dataNodes:
11151123 config:
11161124 resources:
@@ -1148,7 +1156,8 @@ spec:
11481156 image:
11491157 productVersion: 3.3.4
11501158 stackableVersion: 0.2.0
1151- zookeeperConfigMapName: hdfs-zk
1159+ clusterConfig:
1160+ zookeeperConfigMapName: hdfs-zk
11521161 dataNodes:
11531162 roleGroups:
11541163 default:
@@ -1181,7 +1190,8 @@ spec:
11811190 image:
11821191 productVersion: 3.3.4
11831192 stackableVersion: 0.2.0
1184- zookeeperConfigMapName: hdfs-zk
1193+ clusterConfig:
1194+ zookeeperConfigMapName: hdfs-zk
11851195 nameNodes:
11861196 roleGroups:
11871197 default:
@@ -1245,7 +1255,8 @@ spec:
12451255 image:
12461256 productVersion: 3.3.4
12471257 stackableVersion: 0.2.0
1248- zookeeperConfigMapName: hdfs-zk
1258+ clusterConfig:
1259+ zookeeperConfigMapName: hdfs-zk
12491260 dataNodes:
12501261 config:
12511262 resources:
@@ -1299,7 +1310,8 @@ spec:
12991310 image:
13001311 productVersion: 3.3.4
13011312 stackableVersion: 0.2.0
1302- zookeeperConfigMapName: hdfs-zk
1313+ clusterConfig:
1314+ zookeeperConfigMapName: hdfs-zk
13031315 dataNodes:
13041316 roleGroups:
13051317 default:
0 commit comments