Skip to content

Make RepositoryData Less Memory Heavy (#55293)#55468

Merged
original-brownbear merged 2 commits intoelastic:7.xfrom
original-brownbear:55293-7.x
Apr 20, 2020
Merged

Make RepositoryData Less Memory Heavy (#55293)#55468
original-brownbear merged 2 commits intoelastic:7.xfrom
original-brownbear:55293-7.x

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

We don't really need LinkedHashSet here. We can assume that all the
entries are unique and just use a list and use the list utilities to
create the cheapest possible version of the list.
Also, this fixes a bug in addSnapshot which would mutate the existing
linked hash set on the current instance (fortunately this never caused a real world bug)
and brings the collection in line with the java docs on its getter that claim immutability.

backport of #55293

We don't really need `LinkedHashSet` here. We can assume that all the
entries are unique and just use a list and use the list utilities to
create the cheapest possible version of the list.
Also, this fixes a bug in `addSnapshot` which would mutate the existing
linked hash set on the current instance (fortunately this never caused a real world bug)
and brings the collection in line with the java docs on its getter that claim immutability.
@original-brownbear original-brownbear added :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs backport labels Apr 20, 2020
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@original-brownbear original-brownbear merged commit a0763d9 into elastic:7.x Apr 20, 2020
@original-brownbear original-brownbear deleted the 55293-7.x branch April 20, 2020 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants