You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by ki...@apache.org on 2013/08/21 20:22:09 UTC
svn commit: r1516243 - in
/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs:
CHANGES.txt
src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Author: kihwal
Date: Wed Aug 21 18:22:09 2013
New Revision: 1516243
URL: http://svn.apache.org/r1516243
Log:
HDFS-4994. Audit log getContentSummary() calls. Contributed by Robert Parker.
Modified:
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1516243&r1=1516242&r2=1516243&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Wed Aug 21 18:22:09 2013
@@ -14,6 +14,7 @@ Release 0.23.10 - UNRELEASED
HDFS-5047. Supress logging of full stack trace of quota and lease
exceptions. (Robert Parker via kihwal)
+ HDFS-4994. Audit log getContentSummary() calls. (Robert Parker via kihwal)
OPTIMIZATIONS
Modified: hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1516243&r1=1516242&r2=1516243&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java (original)
+++ hadoop/common/branches/branch-0.23/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java Wed Aug 21 18:22:09 2013
@@ -2120,8 +2120,20 @@ public class FSNamesystem implements Nam
return true;
}
- ContentSummary getContentSummary(String src) throws AccessControlException,
- FileNotFoundException, UnresolvedLinkException {
+ /**
+ * Get the content summary for a specific file/dir.
+ *
+ * @param src The string representation of the path to the file
+ *
+ * @throws AccessControlException if access is denied
+ * @throws UnresolvedLinkException if a symlink is encountered.
+ * @throws FileNotFoundException if no file exists
+ * @throws IOException for issues with writing to the audit log
+ *
+ * @return object containing information regarding the file
+ * or null if file not found
+ */
+ ContentSummary getContentSummary(String src) throws IOException {
FSPermissionChecker pc = getPermissionChecker();
readLock();
try {
@@ -2131,6 +2143,7 @@ public class FSNamesystem implements Nam
return dir.getContentSummary(src);
} finally {
readUnlock();
+ logAuditEvent("contentSummary", src);
}
}