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_r298151667
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java ########## @@ -513,12 +518,33 @@ private boolean isHdfsAclSet(Table aclTable, String userName, String namespace, return isSet; } - private boolean checkInitialized() { + @VisibleForTesting + boolean checkInitialized(Supplier<String> operation) { if (initialized) { - return true; - } else { - return false; + if (aclTableInitialized) { + return true; + } else { + LOG.warn("Skip set HDFS acls because acl table is not initialized when " + operation.get()); + } } + return false; + } + + private boolean needSetTableHdfsAcl(TablePermission tablePermission) throws IOException { + return needSetTableHdfsAcl(tablePermission.getTableName(), () -> "") + && hdfsAclHelper.checkTablePermissionHasNoCfOrCq(tablePermission); + } + + private boolean needSetTableHdfsAcl(TableName tableName, Supplier<String> operation) Review comment: Also can remoe the Supplier wrapper ? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services