update readMap to avoid resizing map during reading#84045
update readMap to avoid resizing map during reading#84045idegtiarenko merged 5 commits intoelastic:masterfrom
readMap to avoid resizing map during reading#84045Conversation
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
DaveCTurner
left a comment
There was a problem hiding this comment.
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.