@@ -60,6 +60,7 @@ pub const JVM_SECURITY_PROPERTIES_FILE: &str = "security.properties";
6060
6161pub const HBASE_CLUSTER_DISTRIBUTED : & str = "hbase.cluster.distributed" ;
6262pub const HBASE_ROOTDIR : & str = "hbase.rootdir" ;
63+ const DEFAULT_HBASE_ROOTDIR : & str = "/hbase" ;
6364
6465const HBASE_UI_PORT_NAME_HTTP : & str = "ui-http" ;
6566const HBASE_UI_PORT_NAME_HTTPS : & str = "ui-https" ;
@@ -87,6 +88,10 @@ const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_
8788
8889const DEFAULT_LISTENER_CLASS : & str = "cluster-internal" ;
8990
91+ fn default_hbase_rootdir ( ) -> String {
92+ DEFAULT_HBASE_ROOTDIR . to_string ( )
93+ }
94+
9095pub type MasterRoleType =
9196 Role < HbaseConfigFragment , v1alpha1:: HbaseConfigOverrides , GenericRoleConfig , JavaCommonConfig > ;
9297
@@ -593,7 +598,7 @@ impl HbaseRole {
593598 } ;
594599
595600 HbaseConfigFragment {
596- hbase_rootdir : None ,
601+ hbase_rootdir : Some ( default_hbase_rootdir ( ) ) ,
597602 resources,
598603 logging : product_logging:: spec:: default_logging ( ) ,
599604 affinity : get_affinity ( cluster_name, self , hdfs_discovery_cm_name) ,
@@ -796,7 +801,7 @@ impl AnyConfigFragment {
796801 match role {
797802 HbaseRole :: RegionServer => {
798803 AnyConfigFragment :: RegionServer ( RegionServerConfigFragment {
799- hbase_rootdir : None ,
804+ hbase_rootdir : Some ( default_hbase_rootdir ( ) ) ,
800805 resources : default_resources ( role) ,
801806 logging : product_logging:: spec:: default_logging ( ) ,
802807 affinity : get_affinity ( cluster_name, role, hdfs_discovery_cm_name) ,
@@ -814,7 +819,7 @@ impl AnyConfigFragment {
814819 } )
815820 }
816821 HbaseRole :: RestServer => AnyConfigFragment :: RestServer ( HbaseConfigFragment {
817- hbase_rootdir : None ,
822+ hbase_rootdir : Some ( default_hbase_rootdir ( ) ) ,
818823 resources : default_resources ( role) ,
819824 logging : product_logging:: spec:: default_logging ( ) ,
820825 affinity : get_affinity ( cluster_name, role, hdfs_discovery_cm_name) ,
@@ -825,7 +830,7 @@ impl AnyConfigFragment {
825830 listener_class : Some ( DEFAULT_LISTENER_CLASS . to_string ( ) ) ,
826831 } ) ,
827832 HbaseRole :: Master => AnyConfigFragment :: Master ( HbaseConfigFragment {
828- hbase_rootdir : None ,
833+ hbase_rootdir : Some ( default_hbase_rootdir ( ) ) ,
829834 resources : default_resources ( role) ,
830835 logging : product_logging:: spec:: default_logging ( ) ,
831836 affinity : get_affinity ( cluster_name, role, hdfs_discovery_cm_name) ,
@@ -891,8 +896,9 @@ pub enum Container {
891896 serde( rename_all = "camelCase" )
892897) ]
893898pub struct HbaseConfig {
894- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
895- pub hbase_rootdir : Option < String > ,
899+ /// Root directory for Hbase on the filesystem (usually a path in HDFS). Default is `/hbase`.
900+ #[ serde( default = "default_hbase_rootdir" ) ]
901+ pub hbase_rootdir : String ,
896902
897903 #[ fragment_attrs( serde( default ) ) ]
898904 pub resources : Resources < HbaseStorageConfig , NoRuntimeLimits > ,
@@ -971,8 +977,8 @@ impl Atomic for RegionMoverExtraCliOpts {}
971977 serde( rename_all = "camelCase" )
972978) ]
973979pub struct RegionServerConfig {
974- #[ serde( default , skip_serializing_if = "Option::is_none " ) ]
975- pub hbase_rootdir : Option < String > ,
980+ #[ serde( default = "default_hbase_rootdir " ) ]
981+ pub hbase_rootdir : String ,
976982 #[ fragment_attrs( serde( default ) ) ]
977983 pub resources : Resources < HbaseStorageConfig , NoRuntimeLimits > ,
978984 #[ fragment_attrs( serde( default ) ) ]
@@ -1064,9 +1070,9 @@ impl AnyServiceConfig {
10641070 }
10651071 }
10661072
1067- /// The configured `hbase.rootdir`, if any . Previously injected into
1073+ /// The configured `hbase.rootdir`. Previously injected into
10681074 /// `hbase-site.xml` via product-config's `compute_files`.
1069- pub fn hbase_rootdir ( & self ) -> Option < String > {
1075+ pub fn hbase_rootdir ( & self ) -> String {
10701076 match self {
10711077 AnyServiceConfig :: Master ( config) => config. hbase_rootdir . clone ( ) ,
10721078 AnyServiceConfig :: RegionServer ( config) => config. hbase_rootdir . clone ( ) ,
0 commit comments