You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/29 16:11:04 UTC

[GitHub] [ozone] sodonnel opened a new pull request #2379: HDDS-5398. Avoid object creation in ReplicationManger debug log statements

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel merged pull request #2379: HDDS-5398. Avoid object creation in ReplicationManger debug log statements

Posted by GitBox <gi...@apache.org>.
sodonnel merged pull request #2379:
URL: https://github.com/apache/ozone/pull/2379


   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JacksonYao287 commented on pull request #2379: HDDS-5398. Avoid object creation in ReplicationManger debug log statements

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2379:
URL: https://github.com/apache/ozone/pull/2379#issuecomment-871035845


   LGTM. thanks @sodonnel for this work.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org