You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/03/30 20:15:43 UTC

[GitHub] dlg99 commented on a change in pull request #1311: (WIP) Issue #1310: Filter out body and masterKey from ProcessorV3s

dlg99 commented on a change in pull request #1311: (WIP) Issue #1310: Filter out body and masterKey from ProcessorV3s
URL: https://github.com/apache/bookkeeper/pull/1311#discussion_r178369290
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessorV3.java
 ##########
 @@ -170,4 +170,18 @@ public void safeRun() {
                          requestProcessor.addRequestStats);
         }
     }
+
+    /**
+     * this toString method filters out body and masterKey from the output.
+     * masterKey contains the password of the ledger and body is customer data,
+     * so it is not appropriate to have these in logs or system output.
+     */
+    @Override
+    public String toString() {
+        Request.Builder reqBuilder = Request.newBuilder().setHeader(request.getHeader());
 
 Review comment:
   1. Response goes through the same OrderedSafeExecutor and can get logged similarly. Luckily, in the cases I see when response is wrapped into Runnable we also redefine toString for runnable.
   
   2. BookieProtocol.Request defines toString as:
   
   ```
   public String toString() {
               return String.format("Op(%d)[Ledger:%d,Entry:%d]", opCode, ledgerId, entryId);
           }
   ```
   
   This should be enough, maybe add tx id to that

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services