I am looking for an embeddable library for doing atomic file I/O from java. I need the library to support the following features.
- basic page management -- allocate/free pages and read/write
- atomic (all or nothing) writes (basically journaled I/O)
A simple binary page format (needs to be readable by C++)
It does not need to be that fast (or concurrent), just simple and reliable.
Has anyone used something in the past which fits the bill?
Things I have looked into
I found the internals for the kaha db project to be useful, but development seems to have switched to a fusesoure project called hawtdb. Hawt currently seems to rely memory mapped I/O which sounds good at first, but limits the size of the page file you can access to 2GB unless you go to a 64bit JVM + OS (due to JVM address space limitations).
Some alternatives I am considering are the Cassandra project, but I don't know if its embeddable. I've looked into derby (which created lots of files when run) and H2 (which seemed promising, but I didn't look too deeply). These seemed to have relatively complex page file formats and seem to provide far more than I need. MySQL did provide docs for the page file format, but it too was a bit complex.