Skip to content

Conversation

@rjernst
Copy link
Member

@rjernst rjernst commented Apr 28, 2022

The Version class has two internal static maps for keeping track of the
known Version objects and quickly decoding from a version id into the
known Version object. This commit converts these maps to HashMaps.

relates #86239

The Version class has two internal static maps for keeping track of the
known Version objects and quickly decoding from a version id into the
known Version object. This commit converts these maps to HashMaps.

relates elastic#86239
@rjernst rjernst added :Core/Infra/Core Core issues without another label >refactoring v8.3.0 labels Apr 28, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 28, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM lets use the faster immutable map though?

builderByString.put(V_EMPTY.toString(), V_EMPTY);
idToVersion = builder.build();
stringToVersion = builderByString.build();
idToVersion = Collections.unmodifiableMap(builder);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets just do Map.copyOf for a smaller + faster map?

@rjernst rjernst merged commit 74e9d7c into elastic:master Apr 28, 2022
@rjernst rjernst deleted the hppc/version_maps branch April 28, 2022 19:57
@rjernst rjernst mentioned this pull request Apr 29, 2022
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants