jojochuang commented on a change in pull request #3538:
URL: https://github.com/apache/hadoop/pull/3538#discussion_r737965807



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
##########
@@ -450,6 +460,25 @@ private void logAuditEvent(boolean succeeded,
     }
   }
 
+  private void appendClientPortToCallerContextIfAbsent() {
+    String clientPortInfo = CLIENT_PORT_STR + ":" + Server.getRemotePort();
+    final CallerContext ctx = CallerContext.getCurrent();
+    if (isClientPortInfoAbsent(clientPortInfo, ctx)) {
+      String origContext = ctx == null ? null : ctx.getContext();
+      byte[] origSignature = ctx == null ? null : ctx.getSignature();
+      CallerContext.setCurrent(
+          new CallerContext.Builder(origContext, contextFieldSeparator)
+              .append(clientPortInfo)

Review comment:
       this is good. To make it more understandable, you may use
   append(CLIENT_PORT_STR, Server.getRemotePort())  instead. (will need to 
update TestAuditlogger accordingly)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to