-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-14169. Reduce copying of maps in OmKeyArgs #9631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
CC @Russole |
|
@adoroszlai Thanks for the ping and for picking this up. |
| addAllMetadata(metadatamap); | ||
| if (Boolean.parseBoolean(metadata.get(OzoneConsts.GDPR_FLAG))) { | ||
| GDPRSymmetricKey.newDefaultInstance().acceptKeyDetails(metadata::put); | ||
| if (Boolean.parseBoolean(metadatamap.get(OzoneConsts.GDPR_FLAG))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a null check on metadatamap before using the getter? metadatamap might be null. Alternatively use the underlying map that's being added to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added a null check.
siddhantsangwan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to complete my understanding - how does this change reduce copying of maps?
When ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ResolvedBucket.java Lines 106 to 111 in fb097af
|
What changes were proposed in this pull request?
Reduce copying of maps in
OmKeyArgs:metadatamap fromWithMetadataand its builderMapBuilderfortagsinOmKeyArgs.BuilderSince
metadatais now immutable, changeBlockOutputStreamEntryPoolandBlockDataStreamOutputEntryPoolto keep anOmKeyArgs.Builderinstead ofOmKeyArgs.https://issues.apache.org/jira/browse/HDDS-14169
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/20959833882