You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by el...@apache.org on 2018/12/07 22:28:50 UTC
[07/51] [abbrv] hbase git commit: HBASE-21489 TestShell is broken
HBASE-21489 TestShell is broken
Signed-off-by Duo Zhang <zh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f874232a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f874232a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f874232a
Branch: refs/heads/HBASE-20952
Commit: f874232a679c4806e75f14dd16b3d9c9648cef59
Parents: 825e14b
Author: Reid Chan <re...@apache.org>
Authored: Sat Nov 17 13:20:46 2018 +0800
Committer: Reid Chan <re...@apache.org>
Committed: Sun Nov 18 12:14:52 2018 +0800
----------------------------------------------------------------------
hbase-shell/src/main/ruby/hbase/security.rb | 28 ++++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/f874232a/hbase-shell/src/main/ruby/hbase/security.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/security.rb b/hbase-shell/src/main/ruby/hbase/security.rb
index f16ee6a..5275898 100644
--- a/hbase-shell/src/main/ruby/hbase/security.rb
+++ b/hbase-shell/src/main/ruby/hbase/security.rb
@@ -142,21 +142,25 @@ module Hbase
res = {}
count = 0
all_perms.each do |value|
- user_name = String.from_java_bytes(value.getUser)
+ user_name = value.getUser
+ permission = value.getPermission
+ table = ''
+ family = ''
+ qualifier = ''
if !table_regex.nil? && isNamespace?(table_regex)
- namespace = value.getNamespace
+ nsPerm = permission.to_java(org.apache.hadoop.hbase.security.access.NamespacePermission)
+ namespace = nsPerm.getNamespace
else
- namespace = !value.getTableName.nil? ? value.getTableName.getNamespaceAsString : value.getNamespace
+ tblPerm = permission.to_java(org.apache.hadoop.hbase.security.access.TablePermission)
+ namespace = tblPerm.getNamespace
+ table = !tblPerm.getTableName.nil? ? tblPerm.getTableName.getNameAsString : ''
+ family = !tblPerm.getFamily.nil? ?
+ org.apache.hadoop.hbase.util.Bytes.toStringBinary(tblPerm.getFamily) : ''
+ qualifier = !tblPerm.getQualifier.nil? ?
+ org.apache.hadoop.hbase.util.Bytes.toStringBinary(tblPerm.getQualifier) : ''
end
- table = !value.getTableName.nil? ? value.getTableName.getNameAsString : ''
- family = !value.getFamily.nil? ?
- org.apache.hadoop.hbase.util.Bytes.toStringBinary(value.getFamily) :
- ''
- qualifier = !value.getQualifier.nil? ?
- org.apache.hadoop.hbase.util.Bytes.toStringBinary(value.getQualifier) :
- ''
-
- action = org.apache.hadoop.hbase.security.access.Permission.new value.getActions
+
+ action = org.apache.hadoop.hbase.security.access.Permission.new permission.getActions
if block_given?
yield(user_name, "#{namespace},#{table},#{family},#{qualifier}: #{action}")