HDDS-14169. Reduce copying of maps in OmKeyArgs#9631
HDDS-14169. Reduce copying of maps in OmKeyArgs#9631adoroszlai merged 3 commits intoapache:masterfrom
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.
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.
Thanks, added a null check.
siddhantsangwan
left a comment
There was a problem hiding this comment.
Just trying to complete my understanding - how does this change reduce copying of maps?
When
|
|
@adoroszlai your explanation sounds good. I have two remaining points to discuss:
|
Hopefully existing tests cover this.
For multi-block keys |
siddhantsangwan
left a comment
There was a problem hiding this comment.
LGTM, thanks @adoroszlai for working on this.
|
Thanks @siddhantsangwan for the review, @Russole for starting work on this. |
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