@@ -51,12 +51,6 @@ pub const HBASE_CLUSTER_DISTRIBUTED: &str = "hbase.cluster.distributed";
5151pub const HBASE_ROOTDIR : & str = "hbase.rootdir" ;
5252const DEFAULT_HBASE_ROOTDIR : & str = "/hbase" ;
5353
54- const HBASE_UI_PORT_NAME_HTTP : & str = "ui-http" ;
55- const HBASE_UI_PORT_NAME_HTTPS : & str = "ui-https" ;
56- const HBASE_REST_PORT_NAME_HTTP : & str = "rest-http" ;
57- const HBASE_REST_PORT_NAME_HTTPS : & str = "rest-https" ;
58- const HBASE_METRICS_PORT_NAME : & str = "metrics" ;
59-
6054pub const HBASE_MASTER_PORT : u16 = 16000 ;
6155// HBase always uses 16010, regardless of http or https. On 2024-01-17 we decided in Arch-meeting that we want to stick
6256// the port numbers to what the product is doing, so we get the least surprise for users - even when this means we have
@@ -278,80 +272,6 @@ impl HbaseRole {
278272 const DEFAULT_REST_SECRET_LIFETIME : Duration = Duration :: from_days_unchecked ( 1 ) ;
279273 const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT : Duration =
280274 Duration :: from_minutes_unchecked ( 5 ) ;
281-
282- /// Returns the name of the role as it is needed by the `bin/hbase {cli_role_name} start` command.
283- pub fn cli_role_name ( & self ) -> String {
284- match self {
285- HbaseRole :: Master | HbaseRole :: RegionServer => self . to_string ( ) ,
286- // Of course it is not called "restserver", so we need to have this match
287- // instead of just letting the Display impl do it's thing ;P
288- HbaseRole :: RestServer => "rest" . to_string ( ) ,
289- }
290- }
291-
292- /// Returns required port name and port number tuples depending on the role.
293- ///
294- /// Hbase versions 2.6.* will have two ports for each role. The metrics are available on the
295- /// UI port.
296- pub fn ports ( & self , https_enabled : bool ) -> Vec < ( String , u16 ) > {
297- vec ! [
298- ( self . data_port_name( https_enabled) , self . data_port( ) ) ,
299- (
300- Self :: ui_port_name( https_enabled) . to_string( ) ,
301- self . ui_port( ) ,
302- ) ,
303- ]
304- }
305-
306- pub fn data_port ( & self ) -> u16 {
307- match self {
308- HbaseRole :: Master => HBASE_MASTER_PORT ,
309- HbaseRole :: RegionServer => HBASE_REGIONSERVER_PORT ,
310- HbaseRole :: RestServer => HBASE_REST_PORT ,
311- }
312- }
313-
314- pub fn data_port_name ( & self , https_enabled : bool ) -> String {
315- match self {
316- HbaseRole :: Master | HbaseRole :: RegionServer => self . to_string ( ) ,
317- HbaseRole :: RestServer => {
318- if https_enabled {
319- HBASE_REST_PORT_NAME_HTTPS . to_owned ( )
320- } else {
321- HBASE_REST_PORT_NAME_HTTP . to_owned ( )
322- }
323- }
324- }
325- }
326-
327- pub fn ui_port ( & self ) -> u16 {
328- match self {
329- HbaseRole :: Master => HBASE_MASTER_UI_PORT ,
330- HbaseRole :: RegionServer => HBASE_REGIONSERVER_UI_PORT ,
331- HbaseRole :: RestServer => HBASE_REST_UI_PORT ,
332- }
333- }
334-
335- /// Name of the port used by the Web UI, which depends on HTTPS usage
336- pub fn ui_port_name ( has_https_enabled : bool ) -> & ' static str {
337- if has_https_enabled {
338- HBASE_UI_PORT_NAME_HTTPS
339- } else {
340- HBASE_UI_PORT_NAME_HTTP
341- }
342- }
343-
344- pub fn metrics_port ( & self ) -> u16 {
345- match self {
346- HbaseRole :: Master => HBASE_MASTER_METRICS_PORT ,
347- HbaseRole :: RegionServer => HBASE_REGIONSERVER_METRICS_PORT ,
348- HbaseRole :: RestServer => HBASE_REST_METRICS_PORT ,
349- }
350- }
351-
352- pub fn metrics_port_name ( ) -> & ' static str {
353- HBASE_METRICS_PORT_NAME
354- }
355275}
356276
357277fn default_resources ( role : & HbaseRole ) -> ResourcesFragment < HbaseStorageConfig , NoRuntimeLimits > {
0 commit comments