-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-22776 Rename config names in user scan snapshot feature #440
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -511,9 +556,16 @@ boolean isNotFamilyOrQualifierPermission(TablePermission tablePermission) { | |||
return !tablePermission.hasFamily() && !tablePermission.hasQualifier(); | |||
} | |||
|
|||
boolean isTableUserScanSnapshotEnabled(TableDescriptor tableDescriptor) { | |||
public static boolean isAclSyncToHdfsEnabled(Configuration conf) { | |||
String masterCoprocessors = conf.get(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use conf.getStrings to parse the masterCoprocessors ? and then use the HashSet to check the existence of SnapshotScannerHDFSAclController & AccessController ... that would be better...
@@ -213,6 +213,7 @@ public void postCompletedSnapshotAction(ObserverContext<MasterCoprocessorEnviron | |||
public void postCompletedTruncateTableAction(ObserverContext<MasterCoprocessorEnvironment> c, | |||
TableName tableName) throws IOException { | |||
if (needHandleTableHdfsAcl(tableName, "truncateTable " + tableName)) { | |||
hdfsAclHelper.createTableDirectories(tableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create the table directories here ? I guess the TruncateTableProcedure will create the dir ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tmp table dir is deleted after truncate table, so recreate this directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So please add the comment to say : it's mainly used for creating tmp table dir here because ...
public static final String USER_SCAN_SNAPSHOT_ENABLE = "hbase.user.scan.snapshot.enable"; | ||
public static final String USER_SCAN_SNAPSHOT_THREAD_NUMBER = | ||
"hbase.user.scan.snapshot.thread.number"; | ||
public static final String ACL_SYNC_TO_HDFS_ENABLE = "hbase.acl.sync.to.hdfs.enable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to name it as 'hbase.table.acl.sync.to.hdfs.enable' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The steps to config this feature is as followings:
- Check HDFS configuration
- Add master coprocessor:
hbase.coprocessor.master.classes =
“org.apache.hadoop.hbase.security.access.AccessController
,org.apache.hadoop.hbase.security.access.SnapshotScannerHDFSAclController” - Enable this feature:
hbase.acl.sync.to.hdfs.enable=true - Modify table scheme to enable this feature:
alter 't1', CONFIGURATION => {'hbase.acl.sync.to.hdfs.enable' => 'true'}
So this config has two usages in both step 3 and 4.
If step3 is set, the acl will aync to HDFS if grant namespace or global.
Maybe 'hbase.table.acl.sync.to.hdfs.enable' is confused because global and namespace acls are also synced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
.../src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java
Show resolved
Hide resolved
.../src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclController.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
b5d7560
to
02c82a2
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, please address the minor issues when commting. Thanks.
@@ -213,6 +213,7 @@ public void postCompletedSnapshotAction(ObserverContext<MasterCoprocessorEnviron | |||
public void postCompletedTruncateTableAction(ObserverContext<MasterCoprocessorEnvironment> c, | |||
TableName tableName) throws IOException { | |||
if (needHandleTableHdfsAcl(tableName, "truncateTable " + tableName)) { | |||
hdfsAclHelper.createTableDirectories(tableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So please add the comment to say : it's mainly used for creating tmp table dir here because ...
public static final String USER_SCAN_SNAPSHOT_ENABLE = "hbase.user.scan.snapshot.enable"; | ||
public static final String USER_SCAN_SNAPSHOT_THREAD_NUMBER = | ||
"hbase.user.scan.snapshot.thread.number"; | ||
public static final String ACL_SYNC_TO_HDFS_ENABLE = "hbase.acl.sync.to.hdfs.enable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
02c82a2
to
45fb768
Compare
💔 -1 overall
This message was automatically generated. |
No description provided.