@@ -77,37 +77,11 @@ def __init__(self):
7777
7878 def add_options (self ):
7979 self .add_hostoption (name = 'HBase Master' , default_port = self .default_port )
80- self .add_opt ('-S' , '--ssl' , action = 'store_true' ,
81- help = 'Use SSL to HBase UI' )
82- #self.add_opt('-n', '--num-threads', default=self.num_threads, type='int',
83- # help='Number or parallel threads to speed up processing (default: 2, ' +
84- # 'use -n=1 for deterministic host preference order [slower])')
85- #self.add_opt('-R', '--random', action='store_true', help='Randomize order of hosts tested ' +
86- # '(for use with --num-threads=1)')
87- self .add_opt ('-q' , '--quiet' , action = 'store_true' , help = 'Returns no output instead of NO_AVAILABLE_SERVER ' \
88- + '(convenience for scripting)' )
89- self .add_opt ('-T' , '--request-timeout' , metavar = 'secs' , type = 'int' , default = os .getenv ('REQUEST_TIMEOUT' , 2 ),
90- help = 'Timeout for each individual server request in seconds ($REQUEST_TIMEOUT, default: 2 secs)' )
80+ self .add_ssl_opt ()
81+ self .add_common_opts ()
9182
9283 def process_options (self ):
93- hosts = self .get_opt ('host' )
94- self .port = self .get_opt ('port' )
95- if hosts :
96- self .host_list = [host .strip () for host in hosts .split (',' ) if host ]
97- self .host_list += self .args
98- self .host_list = uniq_list_ordered (self .host_list )
99- #self.num_threads = self.get_opt('num_threads')
100- #if self.get_opt('random'):
101- # log_option('random', True)
102- # shuffle(self.host_list)
103- if self .get_opt ('ssl' ):
104- self .protocol = 'https'
105- log_option ('SSL' , 'true' )
106- else :
107- log_option ('SSL' , 'false' )
108- self .request_timeout = self .get_opt ('request_timeout' )
109- validate_int (self .request_timeout , 'request timeout' , 1 , 60 )
110- self .validate_options ()
84+ self .validate_common_opts ()
11185
11286
11387if __name__ == '__main__' :
0 commit comments