Skip to content
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

Create In-memory bloom filter by de-serializing file #1

Open
sumitjha4321 opened this issue Mar 17, 2020 · 0 comments
Open

Create In-memory bloom filter by de-serializing file #1

sumitjha4321 opened this issue Mar 17, 2020 · 0 comments

Comments

@sumitjha4321
Copy link

sumitjha4321 commented Mar 17, 2020

I have two different service, the first creates the bloom filter and the other one uses it.

For the first service which creates the bloom filter, I can build an off-heap bloom filter with memory mapped file as follows.

val bloomFilter = BloomFilter.builder()
	.useOffHeapMemory(true)
	.withExpectedNumberOfItems(numberOfElements)
	.withFalsePositiveRate(expectedFPR)
	.withFileMapped(file)
	.build()

Since the bloom filter bit-vector gets written in file, this file can then be stored somewhere for later usage (effectively achieving serialization).

And while using the filter, I can open this bloom filter just the same way as above and query.
However, if I need to open this file as in-memory bloom filter, the api doesn't support it.

In case of in-memory bloom filter (i.e useOffHeapMemory(false)), there is a check that file parameter in withFileMapped(file) should be null. I understand that this is a valid check, since in-memory bloom filter has nothing to do with file.

But since the library doesn't have serialization/de-serialization, how do I open a bloom filter in-memory from a serialized file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant