hadoop git commit: HDFS-13217. Audit log all EC policy names during addErasureCodingPolicies. Contributed by liaoyuxiangqin.
Repository: hadoop Updated Branches: refs/heads/trunk 3e3963b03 -> ef02f9b23 HDFS-13217. Audit log all EC policy names during addErasureCodingPolicies. Contributed by liaoyuxiangqin. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ef02f9b2 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ef02f9b2 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ef02f9b2 Branch: refs/heads/trunk Commit: ef02f9b233116a10cf9274b3753fe0b8dcbe8d92 Parents: 3e3963b Author: Xiao Chen Authored: Wed Aug 15 09:22:24 2018 -0700 Committer: Xiao Chen Committed: Wed Aug 15 09:23:05 2018 -0700 -- .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef02f9b2/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 ecf7fce..cdd7d48 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 @@ -7538,9 +7538,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, ErasureCodingPolicy[] policies, final boolean logRetryCache) throws IOException { final String operationName = "addErasureCodingPolicies"; -String addECPolicyName = ""; +List addECPolicyNames = new ArrayList<>(policies.length); checkOperation(OperationCategory.WRITE); -List responses = new ArrayList<>(); +List responses = +new ArrayList<>(policies.length); boolean success = false; writeLock(); try { @@ -7551,7 +7552,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, ErasureCodingPolicy newPolicy = FSDirErasureCodingOp.addErasureCodingPolicy(this, policy, logRetryCache); - addECPolicyName = newPolicy.getName(); + addECPolicyNames.add(newPolicy.getName()); responses.add(new AddErasureCodingPolicyResponse(newPolicy)); } catch (HadoopIllegalArgumentException e) { responses.add(new AddErasureCodingPolicyResponse(policy, e)); @@ -7564,7 +7565,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, if (success) { getEditLog().logSync(); } - logAuditEvent(success, operationName, addECPolicyName, null, null); + logAuditEvent(success, operationName, addECPolicyNames.toString(), + null, null); } } - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[10/14] hadoop git commit: HDFS-13217. Audit log all EC policy names during addErasureCodingPolicies. Contributed by liaoyuxiangqin.
HDFS-13217. Audit log all EC policy names during addErasureCodingPolicies. Contributed by liaoyuxiangqin. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/81fbfe50 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/81fbfe50 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/81fbfe50 Branch: refs/heads/branch-3.1 Commit: 81fbfe500e4ac1c57c681db20f620336a072898e Parents: c15853f Author: Xiao Chen Authored: Wed Aug 15 09:22:24 2018 -0700 Committer: Arpit Agarwal Committed: Mon Aug 20 14:56:47 2018 -0700 -- .../apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/81fbfe50/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 5eef12b..f6c8c94 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 @@ -7475,9 +7475,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, ErasureCodingPolicy[] policies, final boolean logRetryCache) throws IOException { final String operationName = "addErasureCodingPolicies"; -String addECPolicyName = ""; +List addECPolicyNames = new ArrayList<>(policies.length); checkOperation(OperationCategory.WRITE); -List responses = new ArrayList<>(); +List responses = +new ArrayList<>(policies.length); boolean success = false; writeLock(); try { @@ -7488,7 +7489,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, ErasureCodingPolicy newPolicy = FSDirErasureCodingOp.addErasureCodingPolicy(this, policy, logRetryCache); - addECPolicyName = newPolicy.getName(); + addECPolicyNames.add(newPolicy.getName()); responses.add(new AddErasureCodingPolicyResponse(newPolicy)); } catch (HadoopIllegalArgumentException e) { responses.add(new AddErasureCodingPolicyResponse(policy, e)); @@ -7501,7 +7502,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, if (success) { getEditLog().logSync(); } - logAuditEvent(success, operationName, addECPolicyName, null, null); + logAuditEvent(success, operationName, addECPolicyNames.toString(), + null, null); } } - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org