HDFS-8176. Record from/to snapshots in audit log for snapshot diff report. Contributed by J. Andreina.

(cherry picked from commit cf6c8a1b4e)
This commit is contained in:
Jing Zhao 2015-04-24 10:23:32 -07:00
parent c184466939
commit 5870d504e1
2 changed files with 9 additions and 2 deletions

View File

@ -151,6 +151,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8052. Move WebHdfsFileSystem into hadoop-hdfs-client. (wheat9)
HDFS-8176. Record from/to snapshots in audit log for snapshot diff report.
(J. Andreina via jing9)
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -7400,8 +7400,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
} finally {
readUnlock();
}
logAuditEvent(diffs != null, "computeSnapshotDiff", null, null, null);
String fromSnapshotRoot = (fromSnapshot == null || fromSnapshot.isEmpty()) ?
path : Snapshot.getSnapshotPath(path, fromSnapshot);
String toSnapshotRoot = (toSnapshot == null || toSnapshot.isEmpty()) ?
path : Snapshot.getSnapshotPath(path, toSnapshot);
logAuditEvent(diffs != null, "computeSnapshotDiff", fromSnapshotRoot,
toSnapshotRoot, null);
return diffs;
}