You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sa...@apache.org on 2020/05/01 19:12:26 UTC
[hbase-operator-tools] branch master updated: HBASE-24222 Remove
FSUtils.checkAccess and replace with FileSystem.access in
hbase-operator-tools (#58)
This is an automated email from the ASF dual-hosted git repository.
sakthi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-operator-tools.git
The following commit(s) were added to refs/heads/master by this push:
new e6e54aa HBASE-24222 Remove FSUtils.checkAccess and replace with FileSystem.access in hbase-operator-tools (#58)
e6e54aa is described below
commit e6e54aa568271c68f03f6833bed1776c80fcc0cd
Author: niuyulin <yu...@gmail.com>
AuthorDate: Fri May 1 14:12:16 2020 -0500
HBASE-24222 Remove FSUtils.checkAccess and replace with FileSystem.access in hbase-operator-tools (#58)
Signed-off-by: niuyulin <ni...@xiaomi.com>
Signed-off-by: Sakthi <sa...@apache.org>
---
hbase-hbck2/src/main/java/org/apache/hbase/hbck1/HBaseFsck.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hbase-hbck2/src/main/java/org/apache/hbase/hbck1/HBaseFsck.java b/hbase-hbck2/src/main/java/org/apache/hbase/hbck1/HBaseFsck.java
index dcf88bb..7cda06b 100644
--- a/hbase-hbck2/src/main/java/org/apache/hbase/hbck1/HBaseFsck.java
+++ b/hbase-hbck2/src/main/java/org/apache/hbase/hbck1/HBaseFsck.java
@@ -125,7 +125,6 @@ import org.apache.hadoop.hbase.replication.ReplicationException;
import org.apache.hadoop.hbase.replication.ReplicationPeerDescription;
import org.apache.hadoop.hbase.replication.ReplicationQueueStorage;
import org.apache.hadoop.hbase.replication.ReplicationStorageFactory;
-import org.apache.hadoop.hbase.security.AccessDeniedException;
import org.apache.hadoop.hbase.security.UserProvider;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Bytes.ByteArrayComparator;
@@ -145,6 +144,7 @@ import org.apache.hadoop.hbase.zookeeper.ZKWatcher;
import org.apache.hadoop.hbase.zookeeper.ZNodePaths;
import org.apache.hadoop.hdfs.protocol.AlreadyBeingCreatedException;
import org.apache.hadoop.ipc.RemoteException;
+import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.util.Tool;
@@ -2450,7 +2450,7 @@ public class HBaseFsck extends Configured implements Closeable {
}
}
- private void preCheckPermission() throws IOException, AccessDeniedException {
+ private void preCheckPermission() throws IOException {
if (shouldIgnorePreCheckPermission()) {
return;
}
@@ -2462,8 +2462,8 @@ public class HBaseFsck extends Configured implements Closeable {
FileStatus[] files = fs.listStatus(hbaseDir);
for (FileStatus file : files) {
try {
- FSUtils.checkAccess(ugi, file, FsAction.WRITE);
- } catch (AccessDeniedException ace) {
+ fs.access(file.getPath(), FsAction.WRITE);
+ } catch (AccessControlException ace) {
LOG.warn("Got AccessDeniedException when preCheckPermission ", ace);
errors.reportError(ErrorReporter.ERROR_CODE.WRONG_USAGE, "Current user " +
ugi.getUserName() + " does not have write perms to " + file.getPath() +