1

I am very pressed for memory, so I prefer not to read entire HashMap into memory. At the same time I need to perform contains() and remove() operations on that HashMap. It can be a regular hashmap, but preferrably it shall be a counting BloomFilter which allows to store Set as values (searchable by hashes of such Set values).

I found an implementation here - MemoryCountingBloomFilter. I do not use Redis, so their implementation for Redis is not suitable in my case. My application does not have any database and totally relies on disk IO (I know it is very bad, but it is legacy/for a reason and cannot be changed).

Could you possibly offer any solution or any hint?

P.S. I understand that hashmap relies on being totally loaded into memory and probably cannot be used swapped "from disk" (read by small parts into main memory), but may be still there is a clever algorithm? Also, if I just make a List, read elements from disk one by one and check by equals (thus "implementing" O(n) "contains()") - I cannot imagine how to code it being "from disk".

ryupoi
  • 11
  • 1
  • 2
    There are many pre-existing solutions discussed in this question. https://stackoverflow.com/questions/2654709/disk-based-hashmap – ilooner Jul 29 '18 at 07:40

0 Answers0