anmolnar commented on a change in pull request #1133: ZOOKEEPER-1260:Audit 
logging in ZooKeeper servers.
URL: https://github.com/apache/zookeeper/pull/1133#discussion_r343119074
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/FinalRequestProcessor.java
 ##########
 @@ -280,6 +306,8 @@ public void processRequest(Request request) {
                 rsp = new CreateResponse(rc.path);
                 err = Code.get(rc.err);
                 requestPathMetricsCollector.registerRequest(request.type, 
rc.path);
+                String createMode = getCreateMode(request);
 
 Review comment:
   This `getCreateMode()` is quite expensive. It should be moved inside the if 
which checks whether audit logging is enabled. You might want to just pass the 
request object to `addAuditLog()` and extract in there if necessary.
   
   Additionally we might not need AuditConstant for every single operation, but 
use OpCode directly. In which case audit logging could be called at one place 
instead of every case branch.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to