Skip to content

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

@sumitjha4321

Description

@sumitjha4321

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions