HBASE-19114 addendum. Split out o.a.h.h.zookeeper from hbase-server and hbase-client. Ruby scripts also used ZooKeeperWatcher.
Signed-off-by: Apekshit Sharma <appy@apache.org>
This commit is contained in:
parent
17de432334
commit
671d36097f
|
@ -85,7 +85,7 @@ def addServers(_options, hostOrServers)
|
||||||
config = HBaseConfiguration.create
|
config = HBaseConfiguration.create
|
||||||
servers = getServerNames(hostOrServers, config)
|
servers = getServerNames(hostOrServers, config)
|
||||||
|
|
||||||
zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, 'draining_servers', nil)
|
zkw = org.apache.hadoop.hbase.zookeeper.ZKWatcher.new(config, 'draining_servers', nil)
|
||||||
parentZnode = zkw.znodePaths.drainingZNode
|
parentZnode = zkw.znodePaths.drainingZNode
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -102,7 +102,7 @@ def removeServers(_options, hostOrServers)
|
||||||
config = HBaseConfiguration.create
|
config = HBaseConfiguration.create
|
||||||
servers = getServerNames(hostOrServers, config)
|
servers = getServerNames(hostOrServers, config)
|
||||||
|
|
||||||
zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, 'draining_servers', nil)
|
zkw = org.apache.hadoop.hbase.zookeeper.ZKWatcher.new(config, 'draining_servers', nil)
|
||||||
parentZnode = zkw.znodePaths.drainingZNode
|
parentZnode = zkw.znodePaths.drainingZNode
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -119,7 +119,7 @@ end
|
||||||
def listServers(_options)
|
def listServers(_options)
|
||||||
config = HBaseConfiguration.create
|
config = HBaseConfiguration.create
|
||||||
|
|
||||||
zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(config, 'draining_servers', nil)
|
zkw = org.apache.hadoop.hbase.zookeeper.ZKWatcher.new(config, 'draining_servers', nil)
|
||||||
parentZnode = zkw.znodePaths.drainingZNode
|
parentZnode = zkw.znodePaths.drainingZNode
|
||||||
|
|
||||||
servers = ZKUtil.listChildrenNoWatch(zkw, parentZnode)
|
servers = ZKUtil.listChildrenNoWatch(zkw, parentZnode)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
include Java
|
include Java
|
||||||
java_import org.apache.hadoop.hbase.HBaseConfiguration
|
java_import org.apache.hadoop.hbase.HBaseConfiguration
|
||||||
java_import org.apache.hadoop.hbase.ServerName
|
java_import org.apache.hadoop.hbase.ServerName
|
||||||
java_import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
|
java_import org.apache.hadoop.hbase.zookeeper.ZKWatcher
|
||||||
java_import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker
|
java_import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker
|
||||||
|
|
||||||
# disable debug/info logging on this script for clarity
|
# disable debug/info logging on this script for clarity
|
||||||
|
@ -30,7 +30,7 @@ org.apache.log4j.Logger.getLogger('org.apache.zookeeper').setLevel(log_level)
|
||||||
|
|
||||||
config = HBaseConfiguration.create
|
config = HBaseConfiguration.create
|
||||||
|
|
||||||
zk = ZooKeeperWatcher.new(config, 'get-active-master', nil)
|
zk = ZKWatcher.new(config, 'get-active-master', nil)
|
||||||
begin
|
begin
|
||||||
puts MasterAddressTracker.getMasterAddress(zk).getHostname
|
puts MasterAddressTracker.getMasterAddress(zk).getHostname
|
||||||
ensure
|
ensure
|
||||||
|
|
Loading…
Reference in New Issue