From c0988a3b9a978b71b43fac01e38af7364904a58c Mon Sep 17 00:00:00 2001 From: stack Date: Wed, 26 Nov 2014 13:00:29 -0800 Subject: [PATCH] HBASE-12580 Zookeeper instantiated even though we might not need it in the shell (Alex Newman) --- hbase-shell/src/main/ruby/hbase/admin.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 96f28529820..05d512bc978 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -37,10 +37,6 @@ module Hbase @admin = @conn.getAdmin() connection = @admin.getConnection() @conf = configuration - @zk_wrapper = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(configuration, - "admin", nil) - zk = @zk_wrapper.getRecoverableZooKeeper().getZooKeeper() - @zk_main = org.apache.zookeeper.ZooKeeperMain.new(zk) @formatter = formatter end @@ -197,6 +193,11 @@ module Hbase #---------------------------------------------------------------------------------------------- # Returns ZooKeeper status dump def zk_dump + @zk_wrapper = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(@conf, + "admin", + nil) + zk = @zk_wrapper.getRecoverableZooKeeper().getZooKeeper() + @zk_main = org.apache.zookeeper.ZooKeeperMain.new(zk) org.apache.hadoop.hbase.zookeeper.ZKUtil::dump(@zk_wrapper) end