-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Remove uses of ImmutableOpen*Map #86239
Comments
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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 do we still plan to keep some (most?) of these as immutable maps, or are we converting to mutable |
Yes I think they can and should remain immutable, just immutable Map instances with Map.of or Map.copyOf. |
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 IndicesShardStoreResponse class uses ImmutableOpenMap and ImmutableOpenIntMap to represent the per index -> shard -> status structure. This commit converts these to Java Maps. relates elastic#86239
The IndicesShardStoreResponse class uses ImmutableOpenMap and ImmutableOpenIntMap to represent the per index -> shard -> status structure. This commit converts these to Java Maps. relates #86239
These tests construct a map of shard to allocation ids. But they only do so get the pairs to put into the index metadata builder. This commit converts it to use HashMap. relates elastic#86239
These tests construct a map of shard to allocation ids. But they only do so get the pairs to put into the index metadata builder. This commit converts it to use HashMap. relates #86239
The readImmutableMap method of StreamInput reads an ImmutableOpenMap. As we work towards elastic#86239, we want to continue using immutable maps, but instead use those from the JDK. This commit renames the existing readImmutableMap to readImmutableOpenMap, and reimplements the existing method to return an immutable Map using Map.of and Map.ofEntries. relates elastic#86239
The routing table builder uses an hppc based immutable map to keep track of shard id to shard table. However, when building the final routing table, it is just converted to an array. This commit switches to a HashMap. relates elastic#86239
The routing table builder uses an hppc based immutable map to keep track of shard id to shard table. However, when building the final routing table, it is just converted to an array. This commit switches to a HashMap. relates #86239
The in sync allocation ids is a mapping from shard to the set of ids currently being processed. When being built, the metadata uses a sparse map, only filling a value for a shard as they are put into the builder. When the final metadata is built, the map is made dense. This commit converts to using a HashMap instead of ImmutableOpenIntMap. The boxed keys should not cause allocations, as long as number of shards is lower than 128. Long term the map itself should become an array, as we know the number of shards (much like the dense primaryTerms array here). However, that change will be a little trickier to make, since we will need to be backward compatible with how diffs are built, currently using Map differences. relates elastic#86239
The readImmutableMap method of StreamInput reads an ImmutableOpenMap. As we work towards #86239, we want to continue using immutable maps, but instead use those from the JDK. This commit renames the existing readImmutableMap to readImmutableOpenMap, and reimplements the existing method to return an immutable Map using Map.of and Map.ofEntries. relates #86239
The IndicesShardStoresResponse had ImmutableOpenInt map removed, but its use accidentally remained in serialization. Thankfully the format for immutable open maps are interchangable with read java Map. This commit switches to using the new readImmutableMap to read the store statuses. relates elastic#86239
The in sync allocation ids is a mapping from shard to the set of ids currently being processed. When being built, the metadata uses a sparse map, only filling a value for a shard as they are put into the builder. When the final metadata is built, the map is made dense. This commit converts to using a HashMap instead of ImmutableOpenIntMap. The boxed keys should not cause allocations, as long as number of shards is lower than 128. Long term the map itself should become an array, as we know the number of shards (much like the dense primaryTerms array here). However, that change will be a little trickier to make, since we will need to be backward compatible with how diffs are built, currently using Map differences. relates #86239
The IndicesShardStoresResponse had ImmutableOpenInt map removed, but its use accidentally remained in serialization. Thankfully the format for immutable open maps are interchangable with read java Map. This commit switches to using the new readImmutableMap to read the store statuses. relates #86239
The InternalClusterInfoService internally uses ImmutableOpenMap for keeping track of available space on each node. This commit converts those usages to use HashMap. Note that an unmodifiableMap wrapper is used because updates to this (from each node) are likely to happen often as disk is used. relates elastic#86239
The InternalClusterInfoService internally uses ImmutableOpenMap for keeping track of available space on each node. This commit converts those usages to use HashMap. Note that an unmodifiableMap wrapper is used because updates to this (from each node) are likely to happen often as disk is used. relates #86239
Actions for getting aliases, indices, and settings all return a Map. Yet internally these unnecessarily ImmutableOpenMap. This commit converts these actions to use HashMap. relates elastic#86239
Actions for getting aliases, indices, and settings all return a Map. Yet internally these unnecessarily ImmutableOpenMap. This commit converts these actions to use HashMap. relates #86239
This commit removes ImmutableOpenMap from most test cases from server, where the type is no longer needed because Map is used by the class being constructed. relates elastic#86239
This commit removes ImmutableOpenMap from most test cases from server, where the type is no longer needed because Map is used by the class being constructed. relates #86239
Some tests for rollup were still using ImmutableOpenMap for testing internal methods, even though those methods were already converted to Map. This commit changes those tests to use Map. relates elastic#86239
SegmentStats was changed to use Map, but the method in Engine which computes files sizes for segment stats was never converted. This commit removes that final usage from Engine. relates elastic#86239
SegmentStats was changed to use Map, but the method in Engine which computes files sizes for segment stats was never converted. This commit removes that final usage from Engine. relates #86239
Some tests for rollup were still using ImmutableOpenMap for testing internal methods, even though those methods were already converted to Map. This commit changes those tests to use Map. relates #86239
DiffableUtils has methods for reading and creating diffs of maps. The two implementation types, a JDK Map or ImmutableOpenMap, have different methods and implementations. However, the format of the diff is always the same, so the diff creation can be shared. This commit creates an internal MapBuilder abstraction to allow both Map and ImmutableOpenMap to produce diffs from the same MapDiff implementation. relates elastic#86239
DiffableUtils has methods for reading and creating diffs of maps. The two implementation types, a JDK Map or ImmutableOpenMap, have different methods and implementations. However, the format of the diff is always the same, so the diff creation can be shared. This commit creates an internal MapBuilder abstraction to allow both Map and ImmutableOpenMap to produce diffs from the same MapDiff implementation. relates #86239
Remove ImmutableOpenMap from some server tests relates #86239
|
#90006 caused a performance drop, needs to be thought about more |
After #84735, hppc usage in Elasticsearch is now isolated to
ImmutableOpenMap
andImmutableOpenIntMap
. This is a meta issue delineating the remaining uses of those classes that need to be removed.The text was updated successfully, but these errors were encountered: