hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1530783 - /hbase/branches/0.96/bin/region_mover.rb
Date Wed, 09 Oct 2013 20:25:55 GMT
Author: mbertozzi
Date: Wed Oct  9 20:25:55 2013
New Revision: 1530783

URL: http://svn.apache.org/r1530783
Log:
HBASE-9735 region_mover.rb uses the removed HConnection.getZooKeeperWatcher()

Modified:
    hbase/branches/0.96/bin/region_mover.rb

Modified: hbase/branches/0.96/bin/region_mover.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/bin/region_mover.rb?rev=1530783&r1=1530782&r2=1530783&view=diff
==============================================================================
--- hbase/branches/0.96/bin/region_mover.rb (original)
+++ hbase/branches/0.96/bin/region_mover.rb Wed Oct  9 20:25:55 2013
@@ -88,15 +88,20 @@ end
 def getServerNameForRegion(admin, r)
   if r.isMetaRegion()
     # Hack
-    tracker = org.apache.hadoop.hbase.zookeeper.MetaRegionTracker.new(admin.getConnection().getZooKeeperWatcher(),
RubyAbortable.new())
-    tracker.start()
-    while not tracker.isLocationAvailable()
-      sleep 0.1
+    zkw = org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.new(admin.getConfiguration(),
"region_mover", nil)
+    begin
+      tracker = org.apache.hadoop.hbase.zookeeper.MetaRegionTracker.new(zkw, RubyAbortable.new())
+      tracker.start()
+      while not tracker.isLocationAvailable()
+        sleep 0.1
+      end
+      # Make a fake servername by appending ','
+      metaServer = tracker.getMetaRegionLocation().toString() + ","
+      tracker.stop()
+      return metaServer
+    ensure
+      zkw.close()
     end
-    # Make a fake servername by appending ','
-    metaServer = tracker.getMetaRegionLocation().toString() + ","
-    tracker.stop()
-    return metaServer
   end
   table = nil
   table = getMetaTable(admin.getConfiguration())



Mime
View raw message