@@ -61,12 +61,14 @@ use crate::{
6161 AnyNodeConfig , DataNodeContainer , HdfsNodeRole , HdfsPodRef , NameNodeContainer ,
6262 UpgradeState ,
6363 constants:: {
64- DATANODE_ROOT_DATA_DIR_PREFIX , LISTENER_VOLUME_DIR , LISTENER_VOLUME_NAME ,
65- LIVENESS_PROBE_FAILURE_THRESHOLD , LIVENESS_PROBE_INITIAL_DELAY_SECONDS ,
66- LIVENESS_PROBE_PERIOD_SECONDS , LOG4J_PROPERTIES , NAMENODE_ROOT_DATA_DIR ,
67- READINESS_PROBE_FAILURE_THRESHOLD , READINESS_PROBE_INITIAL_DELAY_SECONDS ,
68- READINESS_PROBE_PERIOD_SECONDS , SERVICE_PORT_NAME_HTTP , SERVICE_PORT_NAME_HTTPS ,
69- SERVICE_PORT_NAME_IPC , SERVICE_PORT_NAME_RPC , STACKABLE_ROOT_DATA_DIR ,
64+ DATANODE_ROOT_DATA_DIR_PREFIX , DEFAULT_DATA_NODE_METRICS_PORT ,
65+ DEFAULT_JOURNAL_NODE_METRICS_PORT , DEFAULT_NAME_NODE_METRICS_PORT , LISTENER_VOLUME_DIR ,
66+ LISTENER_VOLUME_NAME , LIVENESS_PROBE_FAILURE_THRESHOLD ,
67+ LIVENESS_PROBE_INITIAL_DELAY_SECONDS , LIVENESS_PROBE_PERIOD_SECONDS , LOG4J_PROPERTIES ,
68+ NAMENODE_ROOT_DATA_DIR , READINESS_PROBE_FAILURE_THRESHOLD ,
69+ READINESS_PROBE_INITIAL_DELAY_SECONDS , READINESS_PROBE_PERIOD_SECONDS ,
70+ SERVICE_PORT_NAME_HTTP , SERVICE_PORT_NAME_HTTPS , SERVICE_PORT_NAME_IPC ,
71+ SERVICE_PORT_NAME_RPC , STACKABLE_ROOT_DATA_DIR ,
7072 } ,
7173 storage:: DataNodeStorageConfig ,
7274 v1alpha1,
@@ -162,6 +164,8 @@ pub enum ContainerConfig {
162164 web_ui_http_port_name : & ' static str ,
163165 /// Port name of the web UI HTTPS port, used for the liveness probe.
164166 web_ui_https_port_name : & ' static str ,
167+ /// The JMX Exporter metrics port.
168+ metrics_port : u16 ,
165169 } ,
166170 Zkfc {
167171 /// The provided custom container name.
@@ -1222,7 +1226,9 @@ wait_for_termination $!
12221226 resources : Option < & ResourceRequirements > ,
12231227 ) -> Result < String , Error > {
12241228 match self {
1225- ContainerConfig :: Hdfs { role, .. } => {
1229+ ContainerConfig :: Hdfs {
1230+ role, metrics_port, ..
1231+ } => {
12261232 let cvd = ContainerVolumeDirs :: from ( role) ;
12271233 let config_dir = cvd. final_config ( ) ;
12281234 construct_role_specific_jvm_args (
@@ -1232,6 +1238,7 @@ wait_for_termination $!
12321238 hdfs. has_kerberos_enabled ( ) ,
12331239 resources,
12341240 config_dir,
1241+ * metrics_port,
12351242 )
12361243 . with_context ( |_| ConstructJvmArgumentsSnafu {
12371244 role : role. to_string ( ) ,
@@ -1372,6 +1379,7 @@ impl From<HdfsNodeRole> for ContainerConfig {
13721379 ipc_port_name : SERVICE_PORT_NAME_RPC ,
13731380 web_ui_http_port_name : SERVICE_PORT_NAME_HTTP ,
13741381 web_ui_https_port_name : SERVICE_PORT_NAME_HTTPS ,
1382+ metrics_port : DEFAULT_NAME_NODE_METRICS_PORT ,
13751383 } ,
13761384 HdfsNodeRole :: Data => Self :: Hdfs {
13771385 role,
@@ -1380,6 +1388,7 @@ impl From<HdfsNodeRole> for ContainerConfig {
13801388 ipc_port_name : SERVICE_PORT_NAME_IPC ,
13811389 web_ui_http_port_name : SERVICE_PORT_NAME_HTTP ,
13821390 web_ui_https_port_name : SERVICE_PORT_NAME_HTTPS ,
1391+ metrics_port : DEFAULT_DATA_NODE_METRICS_PORT ,
13831392 } ,
13841393 HdfsNodeRole :: Journal => Self :: Hdfs {
13851394 role,
@@ -1388,6 +1397,7 @@ impl From<HdfsNodeRole> for ContainerConfig {
13881397 ipc_port_name : SERVICE_PORT_NAME_RPC ,
13891398 web_ui_http_port_name : SERVICE_PORT_NAME_HTTP ,
13901399 web_ui_https_port_name : SERVICE_PORT_NAME_HTTPS ,
1400+ metrics_port : DEFAULT_JOURNAL_NODE_METRICS_PORT ,
13911401 } ,
13921402 }
13931403 }
0 commit comments