Uh oh!
There was an error while loading. Please reload this page.
HBASE-22580 Add a table attribute to make user scan snapshot feature configurable for table - #336
Conversation
Apache-HBase
commented
Jun 25, 2019
💔 -1 overall
This message was automatically generated. |
| * SnapshotScannerHDFSAclController won't handle HDFS acls for users with table read permission | ||
| * @return true if user scan snapshot is enabled for this table | ||
| */ | ||
| boolean isUserScanSnapshotEnabled(); |
There was a problem hiding this comment.
The TableDescriptor is @InterfaceAudience.Public interfaces, right ? and the snapshot acl is a optional coproccesor ...
I think we can not add an extra specific method in the PUBLIC interface, once someone use this method, then devs can not remove or change this easily, we MUST deprecated it in a old major release, then remove it in another new major release. It is troublesome.
fec069d to
5160c62Compare| } | ||
| boolean isTableUserScanSnapshotEnabled(TableDescriptor tableDescriptor) { | ||
| return tableDescriptor.getCoprocessorDescriptors().stream() |
There was a problem hiding this comment.
Just use the TableDescriptor#hasCoprocessor ?
| if (checkTable(currentDescriptor, () -> "modifyTable " + tableName) | ||
| && !hdfsAclHelper.isTableUserScanSnapshotEnabled(oldDescriptor)) { | ||
| hdfsAclHelper.createTableDirectories(tableName); | ||
| Set<String> users = new HashSet<>(); |
There was a problem hiding this comment.
Abstract an small method here ? I saw many places has the logic: to pick up all the users who has the read permission on table / ns / global etc...
| hdfsAclHelper.getUsersWithTableReadAction(tableName); | ||
| users.addAll(userWithTableReadPermission); | ||
| hdfsAclHelper.addTableAcl(tableName, users); | ||
| try (Table aclTable = |
There was a problem hiding this comment.
Also can abstract a method for the flag updating
Apache-HBase
commented
Jun 25, 2019
💔 -1 overall
This message was automatically generated. |
5160c62 to
f18b3bbCompareApache-HBase
commented
Jun 26, 2019
🎊 +1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
| private boolean checkInitialized() { | ||
| @VisibleForTesting | ||
| boolean checkInitialized(Supplier<String> operation) { |
There was a problem hiding this comment.
Just use the string as the argument ? I don't think here we need the Supplier wrapper ...
| && hdfsAclHelper.checkTablePermissionHasNoCfOrCq(tablePermission); | ||
| } | ||
| private boolean needSetTableHdfsAcl(TableName tableName, Supplier<String> operation) |
There was a problem hiding this comment.
Also can remoe the Supplier wrapper ?
| return userPermission.getPermission().implies(Permission.Action.READ); | ||
| } | ||
| boolean checkTablePermissionHasNoCfOrCq(TablePermission tablePermission) { |
There was a problem hiding this comment.
checkTablePermissionHasNoCfOrCq - > isFamilyOrColumnPermission ?
return it as : tablePermission.hasFamily() || tablePermission.hasQualifier() .
| boolean isTableUserScanSnapshotEnabled(TableDescriptor tableDescriptor) { | ||
| String value = tableDescriptor.getValue(USER_SCAN_SNAPSHOT_ENABLE); | ||
| if (value != null && value.equals("true")) { |
There was a problem hiding this comment.
Just :
return Boolean.valueOf(value) ? | tableUsers, tableName); | ||
| } else if (!aclTableInitialized | ||
| && Bytes.equals(PermissionStorage.ACL_GLOBAL_NAME, tableName.getName())) { | ||
| aclTableInitialized = true; |
There was a problem hiding this comment.
Oh, you update the aclTableInitialized here when add HDFS_ACL_FAMILY in hbase:acl ? Why just update the flag once the modifyTable called successfully ? I think that will be easy to understand.
| } | ||
| boolean isTableUserScanSnapshotEnabled(TableDescriptor tableDescriptor) { | ||
| String value = tableDescriptor.getValue(USER_SCAN_SNAPSHOT_ENABLE); |
There was a problem hiding this comment.
The flag should mean whether will we sync the table access to HDFS files ACL ? I think we should a more clear name ?
f18b3bb to
4da7e94Compare| hdfsAclHelper.addTableAcl(tableName, users); | ||
| SnapshotScannerHDFSAclStorage.addUserTableHdfsAcl(ctx.getEnvironment().getConnection(), | ||
| tableUsers, tableName); | ||
| } |
There was a problem hiding this 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 ?
Apache-HBase
commented
Jun 28, 2019
💔 -1 overall
This message was automatically generated. |
4da7e94 to
e6ed33bCompareApache-HBase
commented
Jul 12, 2019
🎊 +1 overall
This message was automatically generated. |
| admin.modifyTable(builder.build()); | ||
| } | ||
| // wait until acl table is online | ||
| List<RegionInfo> tableRegions = MetaTableAccessor.getTableRegions( |
There was a problem hiding this comment.
Why to wait & assign the hbase:acl region ? In theory, the modifyTable will ensure that all of the regions are online.
| .setPermission(READ_EXECUTE).build(); | ||
| } | ||
| void createNonExistDir(Path path) throws IOException { |
Apache-HBase
commented
Jul 15, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 16, 2019
💔 -1 overall
This message was automatically generated. |
e6ed33b to
531c054CompareApache-HBase
commented
Jul 17, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 20, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 23, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 23, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 23, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 23, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 23, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 24, 2019
💔 -1 overall
This message was automatically generated. |
…configurable for table
531c054 to
5c8a26fCompareApache-HBase
commented
Jul 25, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 25, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 25, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 25, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 26, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 27, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 27, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 27, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 27, 2019
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 28, 2019
🎊 +1 overall
This message was automatically generated. |
…configurable for table (apache#336)
No description provided.