laforge49 / utils

Advanced Java utility classes.

Home Page:http://laforge49.github.io/projects/utils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COW DB with multi-block support

laforge49 opened this issue · comments

Calf is a bit brain dead. We need to create a COW db that supports multiple blocks and on which we can implement B-Trees.

For thread safety, we need to use FileChannel rather than SeekableByteChannel and not depend on file position.

Some operations of a database are privileged, in that they can only be performed as part of a transaction.

So we save the current thread during transaction processing and check during a privileged operation to see if the current thread is the one that was saved.

Allocating and releasing a block are good examples of privileged operations. This is in part because the disk space manager is not thread safe.

With the completion of BlockReference, all that remains is testing.