HDFS-7797. Add audit log for setQuota operation (Rakesh R via umamahesh)

This commit is contained in:
Uma Maheswara Rao G 2015-02-17 20:11:11 +05:30
parent 2f0f756b26
commit f24a56787a
2 changed files with 8 additions and 1 deletions

View File

@ -637,6 +637,8 @@ Release 2.7.0 - UNRELEASED
HDFS-7604. Track and display failed DataNode storage locations in NameNode.
(cnauroth)
HDFS-7797. Add audit log for setQuota operation (Rakesh R via umamahesh)
OPTIMIZATIONS
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.

View File

@ -3814,14 +3814,19 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
throws IOException {
checkOperation(OperationCategory.WRITE);
writeLock();
boolean success = false;
try {
checkOperation(OperationCategory.WRITE);
checkNameNodeSafeMode("Cannot set quota on " + src);
FSDirAttrOp.setQuota(dir, src, nsQuota, ssQuota, type);
success = true;
} finally {
writeUnlock();
if (success) {
getEditLog().logSync();
}
logAuditEvent(success, "setQuota", src);
}
getEditLog().logSync();
}
/** Persist all metadata about this file.