Skip to content

HDDS-16252. Avoid the per-group list copy in OmKeyInfo.verifyAndGetKeyLocations - #11091

Merged
sarvekshayr merged 1 commit into
apache:masterfrom
F64116045:HDDS-16252
Aug 24, 2026
Merged

HDDS-16252. Avoid the per-group list copy in OmKeyInfo.verifyAndGetKeyLocations#11091
sarvekshayr merged 1 commit into
apache:masterfrom
F64116045:HDDS-16252

Conversation

@F64116045

@F64116045 F64116045 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

OmKeyInfo.verifyAndGetKeyLocations() calls createLocationList() only to
iterate over the existing block locations and populate
allocatedBlockLocations.

This change iterates over getLocationLists() directly, avoiding the
intermediate flattened list without changing the resulting block map.

What is the link to the Apache JIRA

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

How was this patch tested?

A local JMH benchmark compared the affected loop with 1, 16, and 128
locations split across 1 or 4 internal lists.

Locations / lists createLocationList() getLocationLists()
1 / 1 544 B/op 160 B/op
1 / 4 808 B/op 160 B/op
16 / 1 1,624 B/op 1,056 B/op
16 / 4 1,888 B/op 1,056 B/op
128 / 1 12,280 B/op 9,904 B/op
128 / 4 12,544 B/op 9,904 B/op

JMH 1.37, OpenJDK 17.0.17, 1 thread, 2 forks, -prof gc.

CI: https://github.com/F64116045/ozone/actions/runs/32586214700

@F64116045
F64116045 marked this pull request as ready for review August 23, 2026 03:17

@chungen0126 chungen0126 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.

+1 LGTM

@sarvekshayr sarvekshayr 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.

@sarvekshayr
sarvekshayr merged commit 8efa8ff into apache:master Aug 24, 2026
58 of 61 checks passed
@sarvekshayr

Copy link
Copy Markdown
Contributor

Thanks @F64116045 for the patch and @chungen0126 for the review.

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.

3 participants