You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "echonesis (via GitHub)" <gi...@apache.org> on 2025/12/12 01:29:22 UTC

[PR] HDDS-14122. Make OmKeyInfo ACL list immutable [ozone]

echonesis opened a new pull request, #9486:
URL: https://github.com/apache/ozone/pull/9486

   ## What changes were proposed in this pull request?
   Avoid in-place mutation of ACL list in OmKeyInfo.
   Reference PR: https://github.com/apache/ozone/pull/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/20136327944
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-14122. Make OmKeyInfo ACL list immutable [ozone]

Posted by "echonesis (via GitHub)" <gi...@apache.org>.
echonesis commented on PR #9486:
URL: https://github.com/apache/ozone/pull/9486#issuecomment-3649044941

   Thanks @adoroszlai for the review and merge.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-14122. Make OmKeyInfo ACL list immutable [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #9486:
URL: https://github.com/apache/ozone/pull/9486


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDDS-14122. Make OmKeyInfo ACL list immutable [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #9486:
URL: https://github.com/apache/ozone/pull/9486#discussion_r2612843491


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyCommitRequest.java:
##########
@@ -243,7 +243,7 @@ public void testAtomicRewrite() throws Exception {
     OmKeyInfo omKeyInfo = omKeyInfoBuilder.build();
     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();

Review Comment:
   Please `addAcl` on `omKeyInfoBuilder` before:
   
   https://github.com/apache/ozone/blob/066a51208b5eec6304821fc1a3e524f0b03c66f6/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyCommitRequest.java#L243



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAclRequestWithFSO.java:
##########
@@ -99,17 +99,15 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, Execut
       omKeyInfo = keyStatus.getKeyInfo();
       // Reverting back the full path to key name
       // Eg: a/b/c/d/e/file1 -> file1
-      omKeyInfo.setKeyName(OzoneFSUtils.getFileName(key));

Review Comment:
   nit: Please also move the comment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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