HBase
  1. HBase
  2. HBASE-10056

region_status.rb not adopted to 0.96 api

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.98.0, 0.96.2
    • Component/s: scripts
    • Labels:
      None
    • Environment:

      x86_64 GNU/Linux

    • Hadoop Flags:
      Reviewed

      Description

      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()
      end
      while true
        if $tablename.nil?
          server_count = admin.getClusterStatus().getRegionsCount()
        else
          #Creating HConnection object
          connection = HConnectionManager::getConnection(config);
          server_count = MetaScanner::allTableRegions(config, connection, $TableName ,false).size()
        end
        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 can someone review this fix ? I will attach patch.

        Activity

        Hide
        Samir Ahmic added a comment -

        Here is patch.

        Show
        Samir Ahmic added a comment - Here is patch.
        Hide
        stack added a comment -

        Thank you Samir. This is pretty bad. Maybe enough to sink the RC I put up last night. Committed to trunk and to 0.96.

        Show
        stack added a comment - Thank you Samir. This is pretty bad. Maybe enough to sink the RC I put up last night. Committed to trunk and to 0.96.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in HBase-TRUNK #4702 (See https://builds.apache.org/job/HBase-TRUNK/4702/)
        HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546416)

        • /hbase/trunk/bin/region_status.rb
        Show
        Hudson added a comment - SUCCESS: Integrated in HBase-TRUNK #4702 (See https://builds.apache.org/job/HBase-TRUNK/4702/ ) HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546416) /hbase/trunk/bin/region_status.rb
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in hbase-0.96 #207 (See https://builds.apache.org/job/hbase-0.96/207/)
        HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546414)

        • /hbase/branches/0.96/bin/region_status.rb
        Show
        Hudson added a comment - SUCCESS: Integrated in hbase-0.96 #207 (See https://builds.apache.org/job/hbase-0.96/207/ ) HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546414) /hbase/branches/0.96/bin/region_status.rb
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in hbase-0.96-hadoop2 #135 (See https://builds.apache.org/job/hbase-0.96-hadoop2/135/)
        HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546414)

        • /hbase/branches/0.96/bin/region_status.rb
        Show
        Hudson added a comment - SUCCESS: Integrated in hbase-0.96-hadoop2 #135 (See https://builds.apache.org/job/hbase-0.96-hadoop2/135/ ) HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546414) /hbase/branches/0.96/bin/region_status.rb
        Hide
        Hudson added a comment -

        FAILURE: Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #855 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/855/)
        HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546416)

        • /hbase/trunk/bin/region_status.rb
        Show
        Hudson added a comment - FAILURE: Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #855 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/855/ ) HBASE-10056 region_status.rb not adopted to 0.96 api (stack: rev 1546416) /hbase/trunk/bin/region_status.rb

          People

          • Assignee:
            Samir Ahmic
            Reporter:
            Samir Ahmic
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development