You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/11/28 18:59:43 UTC

svn commit: r1546414 - /hbase/branches/0.96/bin/region_status.rb

Author: stack
Date: Thu Nov 28 17:59:43 2013
New Revision: 1546414

URL: http://svn.apache.org/r1546414
Log:
HBASE-10056 region_status.rb not adopted to 0.96 api

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

Modified: hbase/branches/0.96/bin/region_status.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/bin/region_status.rb?rev=1546414&r1=1546413&r2=1546414&view=diff
==============================================================================
--- hbase/branches/0.96/bin/region_status.rb (original)
+++ hbase/branches/0.96/bin/region_status.rb Thu Nov 28 17:59:43 2013
@@ -55,6 +55,8 @@ import org.apache.hadoop.hbase.filter.Fi
 import org.apache.hadoop.hbase.util.Bytes
 import org.apache.hadoop.hbase.HRegionInfo
 import org.apache.hadoop.hbase.client.MetaScanner
+import org.apache.hadoop.hbase.HTableDescriptor
+import org.apache.hadoop.hbase.client.HConnectionManager
 
 # disable debug logging on this script for clarity
 log_level = org.apache.log4j.Level::ERROR
@@ -98,7 +100,7 @@ table = nil
 iter = nil
 while true
   begin
-    table = HTable.new config, '.META.'.to_java_bytes
+    table = HTable.new config, 'hbase:meta'.to_java_bytes
     scanner = table.getScanner(scan)
     iter = scanner.iterator
     break
@@ -130,13 +132,14 @@ end
 
 # query the master to see how many regions are on region servers
 if not $tablename.nil?
-  $tableq = HTable.new config, $tablename.to_java_bytes
+  $TableName = HTableDescriptor.new($tablename.to_java_bytes).getTableName()
 end
 while true
   if $tablename.nil?
     server_count = admin.getClusterStatus().getRegionsCount()
   else
-    server_count = MetaScanner::allTableRegions(config,$tablename.to_java_bytes,false).size()
+    connection = HConnectionManager::getConnection(config);
+    server_count = MetaScanner::allTableRegions(config, connection, $TableName ,false).size()
   end
   print "Region Status: #{server_count} / #{meta_count}\n"
   if SHOULD_WAIT and server_count < meta_count