sodonnel opened a new pull request #2379:
URL: https://github.com/apache/ozone/pull/2379


   ## What changes were proposed in this pull request?
   
   There are a few debug log entries in replication manager like this:
   
   ```
       LOG.debug("Handling under-replicated container: {}",
           container.getContainerID());
   
         LOG.debug("Deleting empty container {} replicas,", 
container.containerID());
   ```
   
   Especially the latter one, will always allocates a new ContainerID object on 
each call, even if debug is not enabled.
   
   If we just pass "container" then it will use the container.toString() method 
inside the logger, only if debug is enabled. The `ContainerInfo.toString()` 
looks like:
   
   ```
     @Override
     public String toString() {
       return "ContainerInfo{"
           + "id=" + containerID
           + ", state=" + state
           + ", pipelineID=" + pipelineID
           + ", stateEnterTime=" + stateEnterTime
           + ", owner=" + owner
           + '}';
     }
   ```
   
   It contains some extra information, but some of that may be useful if 
debugging a problem.
   
   I propose just passing container to the debug logged and allowing the 
toString() value to be output in the log.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5398
   
   ## How was this patch tested?
   
   No tests changed or added.
   


-- 
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