You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by zh...@apache.org on 2015/04/20 20:53:48 UTC
[41/50] hadoop git commit: HDFS-8114. Erasure coding: Add auditlog
FSNamesystem#createErasureCodingZone if this operation fails. Contributed by
Rakesh R.
HDFS-8114. Erasure coding: Add auditlog FSNamesystem#createErasureCodingZone if this operation fails. Contributed by Rakesh R.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/44074838
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/44074838
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/44074838
Branch: refs/heads/HDFS-7285
Commit: 4407483885d7eb57c6ffac650684e1df16acaa59
Parents: d4c8f10
Author: Zhe Zhang <zh...@apache.org>
Authored: Mon Apr 13 11:15:02 2015 -0700
Committer: Zhe Zhang <zh...@apache.org>
Committed: Mon Apr 20 10:28:39 2015 -0700
----------------------------------------------------------------------
.../hdfs/server/namenode/FSNamesystem.java | 21 ++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/44074838/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 6cb0436..0d51d59 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -8120,11 +8120,19 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
SafeModeException, AccessControlException {
String src = srcArg;
HdfsFileStatus resultingStat = null;
- checkSuperuserPrivilege();
- checkOperation(OperationCategory.WRITE);
- final byte[][] pathComponents =
- FSDirectory.getPathComponentsForReservedPath(src);
- FSPermissionChecker pc = getPermissionChecker();
+ FSPermissionChecker pc = null;
+ byte[][] pathComponents = null;
+ boolean success = false;
+ try {
+ checkSuperuserPrivilege();
+ checkOperation(OperationCategory.WRITE);
+ pathComponents =
+ FSDirectory.getPathComponentsForReservedPath(src);
+ pc = getPermissionChecker();
+ } catch (Throwable e) {
+ logAuditEvent(success, "createErasureCodingZone", srcArg);
+ throw e;
+ }
writeLock();
try {
checkSuperuserPrivilege();
@@ -8138,11 +8146,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
getEditLog().logSetXAttrs(src, xAttrs, logRetryCache);
final INodesInPath iip = dir.getINodesInPath4Write(src, false);
resultingStat = dir.getAuditFileInfo(iip);
+ success = true;
} finally {
writeUnlock();
}
getEditLog().logSync();
- logAuditEvent(true, "createErasureCodingZone", srcArg, null, resultingStat);
+ logAuditEvent(success, "createErasureCodingZone", srcArg, null, resultingStat);
}
/**