openinx commented on a change in pull request #163: HBASE-21995 Add a 
coprocessor to set HDFS ACL for hbase granted user
URL: https://github.com/apache/hbase/pull/163#discussion_r295095826
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/PermissionStorage.java
 ##########
 @@ -839,17 +840,23 @@ private static boolean validateCFAndCQ(byte[] 
permFamily, byte[] cf, byte[] perm
   }
 
   public static boolean isGlobalEntry(byte[] entryName) {
-    return entryName != null && 
TableName.valueOf(entryName).equals(ACL_TABLE_NAME);
+    return !isNamespaceEntry(entryName) && entryName != null
+        && TableName.valueOf(entryName).equals(ACL_TABLE_NAME);
   }
 
   public static boolean isNamespaceEntry(String entryName) {
-    return entryName != null && entryName.charAt(0) == NAMESPACE_PREFIX;
+    return entryName != null && entryName.length() > 0 && entryName.charAt(0) 
== NAMESPACE_PREFIX;
   }
 
   public static boolean isNamespaceEntry(byte[] entryName) {
     return entryName != null && entryName.length !=0 && entryName[0] == 
NAMESPACE_PREFIX;
   }
 
+  public static boolean isTableEntry(byte[] entryName) {
+    return !isNamespaceEntry(entryName) && entryName != null
+        && !TableName.valueOf(entryName).equals(ACL_TABLE_NAME);
 
 Review comment:
   `TableName.valueOf(entryName).equals(ACL_TABLE_NAME)`
   can be replaced by the : 
   `Bytes.equals(entryName, ACL_TABLE_NAME.toBytes())`
   Because the Bytes#equals will need no the TableName box or unbox, should be 
more faster.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to