You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Guava's bloom filters as part of a persistent file format, i.e. the raw byte array of the bloom filter lives somewhere in the file. It would be beneficial to the efficiency to know the length of the byte array produced by the bloom filter beforehand (i.e. without actually serializing it).
There is already a method called bitSize in the BloomFilter, but unfortunately it is not public. The method also doesn't include the two bytes from the strategy and the number of hash functions, as well as the integer for the length of the bits.data array.
2. What's the best code you can write to accomplish that without the new feature?
The method getSizeOf is very inefficient because it actually serializes the bloom filter to get its size. It would be nice if we could do it without the serialization.
3. What would that same code look like if we added your feature?
1. What are you trying to do?
I am using Guava's bloom filters as part of a persistent file format, i.e. the raw byte array of the bloom filter lives somewhere in the file. It would be beneficial to the efficiency to know the length of the byte array produced by the bloom filter beforehand (i.e. without actually serializing it).
There is already a method called
bitSize
in the BloomFilter, but unfortunately it is not public. The method also doesn't include the two bytes from the strategy and the number of hash functions, as well as the integer for the length of thebits.data
array.2. What's the best code you can write to accomplish that without the new feature?
The method
getSizeOf
is very inefficient because it actually serializes the bloom filter to get its size. It would be nice if we could do it without the serialization.3. What would that same code look like if we added your feature?
(Optional) What would the method signatures for your feature look like?
Concrete Use Cases
Serialization of the bloom filter as a building block for more complex formats.
Packages
com.google.common.hash
Checklist
I agree to follow the code of conduct.
I have read and understood the contribution guidelines.
I have read and understood Guava's philosophy, and I strongly believe that this proposal aligns with it.
I have visited the idea graveyard, and did not see anything similar to this idea.
The text was updated successfully, but these errors were encountered: