HBASE-10056 region_status.rb not adopted to 0.96 api

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1546416 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2013-11-28 18:00:03 +00:00
parent fd7ee9e29c
commit 64f417ab99
1 changed files with 6 additions and 3 deletions

View File

@ -55,6 +55,8 @@ import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter
import org.apache.hadoop.hbase.util.Bytes import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.HRegionInfo import org.apache.hadoop.hbase.HRegionInfo
import org.apache.hadoop.hbase.client.MetaScanner 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 # disable debug logging on this script for clarity
log_level = org.apache.log4j.Level::ERROR log_level = org.apache.log4j.Level::ERROR
@ -98,7 +100,7 @@ table = nil
iter = nil iter = nil
while true while true
begin begin
table = HTable.new config, '.META.'.to_java_bytes table = HTable.new config, 'hbase:meta'.to_java_bytes
scanner = table.getScanner(scan) scanner = table.getScanner(scan)
iter = scanner.iterator iter = scanner.iterator
break break
@ -130,13 +132,14 @@ end
# query the master to see how many regions are on region servers # query the master to see how many regions are on region servers
if not $tablename.nil? if not $tablename.nil?
$tableq = HTable.new config, $tablename.to_java_bytes $TableName = HTableDescriptor.new($tablename.to_java_bytes).getTableName()
end end
while true while true
if $tablename.nil? if $tablename.nil?
server_count = admin.getClusterStatus().getRegionsCount() server_count = admin.getClusterStatus().getRegionsCount()
else 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 end
print "Region Status: #{server_count} / #{meta_count}\n" print "Region Status: #{server_count} / #{meta_count}\n"
if SHOULD_WAIT and server_count < meta_count if SHOULD_WAIT and server_count < meta_count