You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Stephen O'Donnell (Jira)" <ji...@apache.org> on 2021/06/30 08:19:00 UTC

[jira] [Resolved] (HDDS-5398) Avoid object creation in ReplicationManger debug log statements

     [ https://issues.apache.org/jira/browse/HDDS-5398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen O'Donnell resolved HDDS-5398.
-------------------------------------
    Fix Version/s: 1.2.0
       Resolution: Fixed

> Avoid object creation in ReplicationManger debug log statements
> ---------------------------------------------------------------
>
>                 Key: HDDS-5398
>                 URL: https://issues.apache.org/jira/browse/HDDS-5398
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: SCM
>    Affects Versions: 1.1.0
>            Reporter: Stephen O'Donnell
>            Assignee: Stephen O'Donnell
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.2.0
>
>
> There are a few debug log entries in replication manager like this:
> {code}
>     LOG.debug("Handling under-replicated container: {}",
>         container.getContainerID());
>       LOG.debug("Deleting empty container {} replicas,", container.containerID());
> {code}
> Especially the latter one, will always allocate 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:
> {code}
>   @Override
>   public String toString() {
>     return "ContainerInfo{"
>         + "id=" + containerID
>         + ", state=" + state
>         + ", pipelineID=" + pipelineID
>         + ", stateEnterTime=" + stateEnterTime
>         + ", owner=" + owner
>         + '}';
>   }
> {code}
> It contains some extra information, but some of that may be useful if debugging a problem.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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