views:

239

answers:

1

Are there any open source implementations of the following:

given a set of keys and values, and a hash function, build up a hash table in a file image, such that it can then be mapped with a java.nio mapped file to avoid copying all the contents into virtual memory for lookups?

+1  A: 

I have two suggestions, although i'll admit up front I haven't personally used either.

  1. I found this implementation of a File based HashMap. It stores the key values in memory and uses these to work out where the corresponding serialized value is in a random access file. The javadoc i linked too above has a pretty good description of what it does.

  2. You could use a more comprehensive file based database such as the Berkeley DB. There is an Java open-source version available from Oracle. I can't post another link, so you'll have to find it if your interested, sorry.

Binary Nerd