adoroszlai commented on PR #9631:
URL: https://github.com/apache/ozone/pull/9631#issuecomment-3776665138

   > Just trying to complete my understanding - how does this change reduce 
copying of maps?
   
   When `OmKeyArgs` is converted `toBuilder()` for modification, its properties 
are all set on the `Builder`.  Currently, metadata and tags are stored in new 
`HashMap`, so that changes made to the `Builder` do not affect the original 
`OmKeyArgs`.  However, this copying of the maps happens even if metadata/tags 
are not changed, e.g. here:
   
   
https://github.com/apache/ozone/blob/fb097aff57fb8a49e8a175540d5eafe802b3e54b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ResolvedBucket.java#L106-L111
   
   `MapBuilder` stores the original immutable map, and creates mutable copy 
only if and when the map is being modified (new items added, etc.).


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to