diff --git bin/hirb.rb bin/hirb.rb index bd67e39..dc1fecc 100644 --- bin/hirb.rb +++ bin/hirb.rb @@ -114,6 +114,7 @@ require 'shell/formatter' # Setup console @shell = Shell::Shell.new(@hbase, @formatter) +@shell.debug = @shell_debug # Add commands to this namespace @shell.export_commands(self) diff --git bin/region_mover.rb bin/region_mover.rb index 61d8b63..e7a8dd3 100644 --- bin/region_mover.rb +++ bin/region_mover.rb @@ -365,7 +365,7 @@ def loadRegions(options, hostname) begin isSuccessfulScan(admin, r) exists = true - rescue org.apache.hadoop.hbase.exceptions.NotServingRegionException => e + rescue org.apache.hadoop.hbase.NotServingRegionException => e $LOG.info("Failed scan of " + e.message) end count = count + 1 diff --git bin/region_status.rb bin/region_status.rb index 05b2caf..78b4e48 100644 --- bin/region_status.rb +++ bin/region_status.rb @@ -47,7 +47,7 @@ require 'java' import org.apache.hadoop.hbase.HBaseConfiguration import org.apache.hadoop.hbase.HConstants -import org.apache.hadoop.hbase.exceptions.MasterNotRunningException +import org.apache.hadoop.hbase.MasterNotRunningException import org.apache.hadoop.hbase.client.HBaseAdmin import org.apache.hadoop.hbase.client.HTable import org.apache.hadoop.hbase.client.Scan diff --git hbase-server/src/main/ruby/shell/commands.rb hbase-server/src/main/ruby/shell/commands.rb index dc92340..dbfa8fc 100644 --- hbase-server/src/main/ruby/shell/commands.rb +++ hbase-server/src/main/ruby/shell/commands.rb @@ -33,9 +33,13 @@ module Shell #(everything is a message, so this is just the formal semantics to support that idiom) translate_hbase_exceptions(*args) { send(cmd,*args) } rescue => e + rootCause = e + while rootCause != nil && rootCause.respond_to?(:cause) && rootCause.cause != nil + rootCause = rootCause.cause + end puts - puts "ERROR: #{e}" - puts "Backtrace: #{e.backtrace.join("\n ")}" if debug + puts "ERROR: #{rootCause}" + puts "Backtrace: #{rootCause.backtrace.join("\n ")}" if debug puts puts "Here is some help for this command:" puts help