Skip to content

HDDS-15529: Switched minimum/maximum description in ContainerInfo.java javadoc for OPEN/CLOSED containers usedBytes#10580

Open
rnblough wants to merge 2 commits into
apache:masterfrom
rnblough:HDDS-15529
Open

HDDS-15529: Switched minimum/maximum description in ContainerInfo.java javadoc for OPEN/CLOSED containers usedBytes#10580
rnblough wants to merge 2 commits into
apache:masterfrom
rnblough:HDDS-15529

Conversation

@rnblough

@rnblough rnblough commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The javadoc comments in ContainerInfo.java describes the usedBytes values being the opposite of the implementation in AbstractContainerReportHandler.java. This is literal and exact - ContainerInfo.java reports the maximum of values listed over OPEN container replicas and minimum of values over CLOSED container replicas; AbstractContainerReportHandler implements the opposite relationship in the actual values reported:

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);
}

The fix is trivial - I swapped the words 'minimum' and 'maximum' in ContainerInfo.java in order to have the description match the implementation.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15529

How was this patch tested?

Default branch build. Corrected a comment section, no operational impact.

@ashishkumar50 ashishkumar50 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants