You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2019/01/08 09:04:06 UTC

[05/15] hbase git commit: HBASE-21362: Disable printing of stack-trace in shell when quotas are violated

HBASE-21362: Disable printing of stack-trace in shell when quotas are violated

Signed-off-by: Josh Elser <el...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a735a475
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a735a475
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a735a475

Branch: refs/heads/HBASE-21512
Commit: a735a4753250d9be6b5371f08ca1db8f4cede0ab
Parents: 84c1f08
Author: Sakthi <sa...@gmail.com>
Authored: Wed Dec 26 17:01:22 2018 -0800
Committer: Josh Elser <el...@apache.org>
Committed: Mon Jan 7 16:36:48 2019 -0500

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/shell/commands.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a735a475/hbase-shell/src/main/ruby/shell/commands.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands.rb b/hbase-shell/src/main/ruby/shell/commands.rb
index d60d07c..be6dd85 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -169,6 +169,16 @@ module Shell
           strs = str.split("\n")
           raise (strs[0]).to_s unless strs.empty?
         end
+        if cause.is_a?(org.apache.hadoop.hbase.quotas.SpaceLimitingException)
+          strs = cause.message.split("\n")
+          raise(strs[0]).to_s unless strs.empty?
+        end
+        if cause.is_a?(org.apache.hadoop.hbase.client.RetriesExhaustedException)
+          str = cause.cause.to_s
+          regex = /.*RpcThrottlingException: (?<message>[^\n]+).*/
+          error = regex.match(str)
+          raise error[:message].capitalize unless error.nil?
+        end
 
         # Throw the other exception which hasn't been handled above
         raise cause