openinx commented on a change in pull request #336: HBASE-22580 Add a table 
attribute to make user scan snapshot feature configurable for table
URL: https://github.com/apache/hbase/pull/336#discussion_r298539875
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java
 ##########
 @@ -263,14 +262,29 @@ public void 
postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
     }
   }
 
+  @Override
+  public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> 
ctx,
+      TableName tableName, TableDescriptor oldDescriptor, TableDescriptor 
currentDescriptor)
+      throws IOException {
+    if (needHandleTableHdfsAcl(currentDescriptor, "modifyTable " + tableName)
+        && !hdfsAclHelper.isTableUserScanSnapshotEnabled(oldDescriptor)) {
+      hdfsAclHelper.createTableDirectories(tableName);
+      Set<String> tableUsers = 
hdfsAclHelper.getUsersWithTableReadAction(tableName, false, false);
+      Set<String> users =
+          
hdfsAclHelper.getUsersWithNamespaceReadAction(tableName.getNamespaceAsString(), 
true);
+      users.addAll(tableUsers);
+      hdfsAclHelper.addTableAcl(tableName, users);
+      
SnapshotScannerHDFSAclStorage.addUserTableHdfsAcl(ctx.getEnvironment().getConnection(),
+        tableUsers, tableName);
+    }
 
 Review comment:
   How it will happen if we have an TableUserScanSnapshot Enabled table, and 
then modify to disabled ?  I think we shold also remove the HDFS ACL ? 

----------------------------------------------------------------
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