HBASE-21812 replaced a for-loop with an each block.
Each block introduces a new scope, so a local variable defined inside it
cannot be accessed afterwards.
NameError: undefined local variable or method `admin' for main:Object
getServerNames at /opt/khp/hbase/bin/draining_servers.rb:81
addServers at /opt/khp/hbase/bin/draining_servers.rb:88
<main> at /opt/khp/hbase/bin/draining_servers.rb:146
This commit defines the admin local variable in the current scope beforehand,
so that we can still access it after the block.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Modified jruby scripts to pick up drainingZNode and masterAddressZNode
correctly, from within znodePaths in ZooKeeperWatcher. Modified
get-active-master.rb to retrieve server name using MasterAddressTracker
instead of ZKUtil.
Tested on a standalone HBase deployment to check that the scripts work
as expected.
Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Mike Drob <mdrob@apache.org>
* Get hbase-shell to use latest current JRuby release.
* Update license information to reflect the changes to jruby-complete.jar
* Update shell scripts for Ruby 1.8->2.x incompatabilities
* Update joni and jcodings to compatible versions
Signed-off-by: Sean Busbey <busbey@apache.org>