hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samir Ahmic (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-10056) region_status.rb not adopted to 0.96 api
Date Thu, 28 Nov 2013 14:34:35 GMT
Samir Ahmic created HBASE-10056:

             Summary: region_status.rb not adopted to 0.96 api
                 Key: HBASE-10056
                 URL: https://issues.apache.org/jira/browse/HBASE-10056
             Project: HBase
          Issue Type: Bug
          Components: scripts
         Environment: x86_64 GNU/Linux
            Reporter: Samir Ahmic
            Assignee: Samir Ahmic
            Priority: Minor

When I tried to run this script agains 0.96 cluster i got this error:
$ hbase org.jruby.Main region_status.rb
NameError: uninitialized constant IOException
  const_missing at org/jruby/RubyModule.java:2647
         (root) at region_status.rb:104
This line is causing issue:
table = HTable.new config, '.META.'.to_java_bytes
I belive this should be changed to:
table = HTable.new config, 'hbase:meta'.to_java_bytes

Second issue was caused by this line 
server_count = MetaScanner::allTableRegions(config,$tablename.to_java_bytes,false).size()

MetaScanner.allTablesRegion() is changed in 0.96 so i changed few lines in order to fix this:
if not $tablename.nil?
 # Creating TableName object
  $TableName = HTableDescriptor.new($tablename.to_java_bytes).getTableName()
while true
  if $tablename.nil?
    server_count = admin.getClusterStatus().getRegionsCount()
    #Creating HConnection object
    connection = HConnectionManager::getConnection(config);
    server_count = MetaScanner::allTableRegions(config, connection, $TableName ,false).size()
  print "Region Status: #{server_count} / #{meta_count}\n"

After this changes script is working against 0.96. Since i'm far away from expert in jruby
 :D can someone review this fix ? I will attach patch. 

This message was sent by Atlassian JIRA

View raw message