Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B602E1017A for ; Wed, 9 Oct 2013 18:18:51 +0000 (UTC) Received: (qmail 22370 invoked by uid 500); 9 Oct 2013 18:18:45 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 22313 invoked by uid 500); 9 Oct 2013 18:18:44 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 22068 invoked by uid 99); 9 Oct 2013 18:18:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 18:18:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 18:18:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E401E2388AA6; Wed, 9 Oct 2013 18:18:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1530747 - /hbase/branches/0.89-fb/bin/reload_rs_config.rb Date: Wed, 09 Oct 2013 18:18:21 -0000 To: commits@hbase.apache.org From: liyin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131009181821.E401E2388AA6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: liyin Date: Wed Oct 9 18:18:21 2013 New Revision: 1530747 URL: http://svn.apache.org/r1530747 Log: [master] Allow the configuration reload script to make a single host reload config Author: gauravm Summary: As a part of my testing the online configuration change, I found that the command line options for the script which makes the region servers reload their configuration, were not implemented as intended. Made the necessary fixes. Now we can either make all the region servers reload their configurations, or just a specific one. Test Plan: Tested locally, will test on TITANSHADOW025 (Altair) Reviewers: rshroff, adela, manukranthk, aaiyer Reviewed By: manukranthk CC: hbase-eng@ Differential Revision: https://phabricator.fb.com/D1001815 Task ID: 2842041 Modified: hbase/branches/0.89-fb/bin/reload_rs_config.rb Modified: hbase/branches/0.89-fb/bin/reload_rs_config.rb URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/bin/reload_rs_config.rb?rev=1530747&r1=1530746&r2=1530747&view=diff ============================================================================== --- hbase/branches/0.89-fb/bin/reload_rs_config.rb (original) +++ hbase/branches/0.89-fb/bin/reload_rs_config.rb Wed Oct 9 18:18:21 2013 @@ -40,20 +40,21 @@ import java.net.InetAddress NAME = "reload_rs_config" def usage - puts 'Usage %s.rb [reloadAll]' % NAME - puts 'Use reloadAll to make all the Region Servers reload their configurations' + puts 'Usage: %s.rb [reloadAll | hostname]' % NAME + puts 'Use reloadAll to make all the Region Servers reload their configurations, or,' + puts 'Use a specific hostname to make a specific region server reload its configuration' exit! end reloadAll = false -if ARGV.size > 1 +if ARGV.size != 1 usage -elsif ARGV.size == 1 +else if ARGV[0] == 'reloadAll' reloadAll = true else - usage + hostname = ARGV[0] end end @@ -72,7 +73,6 @@ LOG = LogFactory.getLog(NAME) # get the admin interface admin = HBaseAdmin.new(c) -hostname = InetAddress.getLocalHost().getHostName() port = c.getInt("hbase.regionserver.port", 0) if reloadAll @@ -106,6 +106,7 @@ else exit end + puts "Updating the configuration at host " + address.getHostname() admin.updateConfiguration(address) end