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

Ryan Blough reassigned HDDS-15529:
----------------------------------

    Assignee: Ryan Blough

> ContainerInfo describes the opposite of the usedBytes behavior implemented in 
> AbstractContainerReportHandler
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HDDS-15529
>                 URL: https://issues.apache.org/jira/browse/HDDS-15529
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: SCM
>    Affects Versions: 2.1.0, 2.2.0, 2.3.0
>            Reporter: Ryan Blough
>            Assignee: Ryan Blough
>            Priority: Minor
>
> e ContainerInfo.java file reports in the javadocs comment that OPEN 
> containers will be calculated using the maximum of values and CLOSED 
> containers use the minimum of values: 
>  
> {code:java}
> * Returns the usedBytes for the container. The value returned is derived
> * from the replicas reported from the datanodes for the container.
> *
> * The size of a container can change over time. For an open container we
> * assume the size of the container will grow, and hence the value will be
> * the maximum of the values reported from its replicas.
> *
> * A closed container can only reduce in size as its blocks are removed. For
> * a closed container, the value will be the minimum of the values reported
> * from its replicas. {code}
> The AbstractContainerReportHandler.java file implements the opposite 
> relationship:
>  
> {code:java}
>   if (containerInfo.getState().equals(HddsProtos.LifeCycleState.OPEN)) {
>     // Open containers are generally growing in key count and size, the
>     // overall size should be the min of all reported replicas.
>     return Math.min(lastValue, thisValue);
>   } else {
>     // Containers which are not open can only shrink in size, so use the
>     // largest values reported.
>     return Math.max(lastValue, thisValue);
>   }
> } {code}
> Concretely, ContainerInfo.java describes reporting the _anticipated_ values, 
> and AbstractContainerReportHandler.java implements reporting the 
> _conservative current_ values.
> Updating ContainerInfo.java to reflect the actual implementation and testing, 
> for consistency.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to