Skip to content

HDDS-14122. Make OmKeyInfo ACL list immutable#9486

Merged
adoroszlai merged 2 commits intoapache:masterfrom
echonesis:HDDS-14122
Dec 13, 2025
Merged

HDDS-14122. Make OmKeyInfo ACL list immutable#9486
adoroszlai merged 2 commits intoapache:masterfrom
echonesis:HDDS-14122

Conversation

@echonesis
Copy link
Copy Markdown
Contributor

@echonesis echonesis commented Dec 12, 2025

What changes were proposed in this pull request?

Avoid in-place mutation of ACL list in OmKeyInfo.
Reference PR: #9466

  • Change OmKeyInfo.Builder to use AclListBuilder.
  • Change OmKeyInfo#acls to ImmutableList.
  • Change apply method in each Request to use OmKeyInfo.Builder instead of OmKeyInfo.

What is the link to the Apache JIRA

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

How was this patch tested?

GitHub Actions CI: https://github.com/echonesis/ozone/actions/runs/20158237612

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @echonesis for the patch.

Comment on lines 100 to -102
// Reverting back the full path to key name
// Eg: a/b/c/d/e/file1 -> file1
omKeyInfo.setKeyName(OzoneFSUtils.getFileName(key));
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.

nit: Please also move the comment.

omKeyInfo.appendNewBlocks(allocatedLocationList, false);
List<OzoneAcl> acls = Collections.singletonList(OzoneAcl.parseAcl("user:foo:rw"));
omKeyInfo.addAcl(acls.get(0));
omKeyInfo = omKeyInfo.toBuilder().addAcl(acls.get(0)).build();
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.

Please addAcl on omKeyInfoBuilder before:

@echonesis echonesis requested a review from adoroszlai December 12, 2025 08:49
@adoroszlai adoroszlai merged commit d03ef0d into apache:master Dec 13, 2025
44 checks passed
@echonesis
Copy link
Copy Markdown
Contributor Author

Thanks @adoroszlai for the review and merge.

@echonesis echonesis deleted the HDDS-14122 branch December 13, 2025 06:38
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