Hi guys,
now that I'm done with the LDAP API release and ApacheDS release, I'd
like to dedicate some time to complete Mavibot, as it's a critical part
of the server.
The current status is not exactly perfect. It's usable, but there is no
support for transaction across B-trees, which makes it as brittle as
JDBM when it comes to use it in ApacheDS (simply because an update
impact many B-Trees, so it has to be an all-or-nothing operation, which
implies a cross-B-trees transaction).
We have started to implement it in a branch (single-value) where other
changes have been applied :
- no support for multi-values (way too complex to support in this first
version)
- no support for in-memory B-trees (not critical, makes everything more
complex)
Here is how I see transactions being implemented :
- The recordManager will be responsible for creating new transactions.
- each operation on any B-tree will require an extra parameter, the
transaction that it belongs to
- transaction will not last forever, a default timeout of 30 mins will
be used, to avoid long-lasted transactions that would make the database
grow without control (keep in mind that a read transaction holds a
revision until it's aborted, which leads to holding old pages on disk).
So bottom line, here is what an operation will looks like :
RecordManager recordManager = new RecordManager( "MyDatabase" );
Transaction readTransaction = recordManager.beginReadTransaction();
BTree<Long, String> btree = recordManager.getManagedTree(
readTransaction, "MyBtree" );
boolean hasKey = btree.haskey( 1L );
readTransaction.abort(); // COuld have been commit();
More to come in the following weeks.