HADOOP-12776. Remove getaclstatus call for non-acl commands in getfacl. (Contributed by Brahma Reddy Battula)

This commit is contained in:
Vinayakumar B 2016-02-12 11:53:28 +05:30
parent 9b959f3ee7
commit c78740a979
2 changed files with 12 additions and 3 deletions

View File

@ -1120,6 +1120,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-12699. TestKMS#testKMSProvider intermittently fails during HADOOP-12699. TestKMS#testKMSProvider intermittently fails during
'test rollover draining'. (Xiao Chen via wang) 'test rollover draining'. (Xiao Chen via wang)
HADOOP-12776. Remove getaclstatus call for non-acl commands in getfacl.
(Brahma Reddy Battula via vinayakumarb)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-11785. Reduce the number of listStatus operation in distcp HADOOP-11785. Reduce the number of listStatus operation in distcp

View File

@ -86,9 +86,15 @@ class AclCommands extends FsCommand {
(perm.getOtherAction().implies(FsAction.EXECUTE) ? "t" : "T")); (perm.getOtherAction().implies(FsAction.EXECUTE) ? "t" : "T"));
} }
AclStatus aclStatus = item.fs.getAclStatus(item.path); AclStatus aclStatus = null;
List<AclEntry> entries = perm.getAclBit() ? aclStatus.getEntries() List<AclEntry> entries = null;
: Collections.<AclEntry> emptyList(); if (perm.getAclBit()) {
aclStatus = item.fs.getAclStatus(item.path);
entries = aclStatus.getEntries();
} else {
aclStatus = null;
entries = Collections.<AclEntry> emptyList();
}
ScopedAclEntries scopedEntries = new ScopedAclEntries( ScopedAclEntries scopedEntries = new ScopedAclEntries(
AclUtil.getAclFromPermAndEntries(perm, entries)); AclUtil.getAclFromPermAndEntries(perm, entries));
printAclEntriesForSingleScope(aclStatus, perm, printAclEntriesForSingleScope(aclStatus, perm,