@@ -81,16 +81,6 @@ pub const METRICS_PORT: u16 = 9100;
8181
8282pub const JVM_HEAP_FACTOR : f32 = 0.8 ;
8383
84- const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration = Duration :: from_minutes_unchecked ( 20 ) ;
85- const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration =
86- Duration :: from_minutes_unchecked ( 60 ) ;
87- const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration = Duration :: from_minutes_unchecked ( 5 ) ;
88-
89- // Auto TLS certificate lifetime
90- const DEFAULT_MASTER_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
91- const DEFAULT_REGION_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
92- const DEFAULT_REST_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
93-
9484#[ derive( Snafu , Debug ) ]
9585pub enum Error {
9686 #[ snafu( display( "the role [{role}] is invalid and does not exist in HBase" ) ) ]
@@ -267,6 +257,17 @@ pub enum HbaseRole {
267257}
268258
269259impl HbaseRole {
260+ const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration = Duration :: from_minutes_unchecked ( 20 ) ;
261+ const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration =
262+ Duration :: from_minutes_unchecked ( 60 ) ;
263+ const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration =
264+ Duration :: from_minutes_unchecked ( 5 ) ;
265+
266+ // Auto TLS certificate lifetime
267+ const DEFAULT_MASTER_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
268+ const DEFAULT_REGION_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
269+ const DEFAULT_REST_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 7 ) ;
270+
270271 pub fn default_config (
271272 & self ,
272273 cluster_name : & str ,
@@ -309,15 +310,15 @@ impl HbaseRole {
309310 } ;
310311
311312 let graceful_shutdown_timeout = match & self {
312- HbaseRole :: Master => Some ( DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
313- HbaseRole :: RegionServer => Some ( DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
314- HbaseRole :: RestServer => Some ( DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
313+ HbaseRole :: Master => Some ( Self :: DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
314+ HbaseRole :: RegionServer => Some ( Self :: DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
315+ HbaseRole :: RestServer => Some ( Self :: DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT ) ,
315316 } ;
316317
317318 let requested_secret_lifetime = match & self {
318- HbaseRole :: Master => Some ( DEFAULT_MASTER_SECRET_LIFETIME ) ,
319- HbaseRole :: RegionServer => Some ( DEFAULT_REGION_SECRET_LIFETIME ) ,
320- HbaseRole :: RestServer => Some ( DEFAULT_REST_SECRET_LIFETIME ) ,
319+ HbaseRole :: Master => Some ( Self :: DEFAULT_MASTER_SECRET_LIFETIME ) ,
320+ HbaseRole :: RegionServer => Some ( Self :: DEFAULT_REGION_SECRET_LIFETIME ) ,
321+ HbaseRole :: RestServer => Some ( Self :: DEFAULT_REST_SECRET_LIFETIME ) ,
321322 } ;
322323
323324 HbaseConfigFragment {
0 commit comments