-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
update readMap
to avoid resizing map during reading
#84045
update readMap
to avoid resizing map during reading
#84045
Conversation
This commit updates readMap to use helper method that presizes map correctly. It guarantees no resizing when adding given numbers of entries to a hashmap.
Pinging @elastic/es-distributed (Team:Distributed) |
Could we do the same thing for Is there any trickery we can perform to assert that the map really doesn't get resized while we're reading it? |
I believe I didn't integrate the factory method for creating sized |
Will update. Looks like it has only 6 usages. |
I am not sure. |
Submitted #84054 |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @idegtiarenko, I've created a changelog YAML for you. |
# Conflicts: # server/src/main/java/org/elasticsearch/common/util/Maps.java
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.
LGTM, let's come back to the question about asserting no resizing later
This commit updates readMap to use helper method that presizes map correctly. It guarantees no resizing when adding given numbers of entries to a hashmap / linkedhashmap.
This commit updates readMap to use helper method that presizes map
correctly. It guarantees no resizing when adding given numbers of
entries to a hashmap.