Remove Lucene's PackedInt dependency from Cuckoo filter #74946
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, Cuckoo filters use Lucene structures to hold in memory arrays of packed ints. This is problematic when we move to Lucene 9.0 as those classes have been heavily modified, In addition we use Lucene Input/output API to serialise / deserialise the data structure which will break as well as Lucene is changing the API endianness.
Therefore, this PR forks the Lucene data structure into a class called PackedArray. The main change is that this class will be using Elasticsearch streams to serialise / deserialise, therefore we remove the dependency in Lucene's endianness. WE are still using lucene PackedInts to handle backwards compatibility.
We added a ESRestTestCase that can trigger the creation of Cuckoo filters and run in a mixed cluster in order to check backwards compatibility.
backport #74736