class type blockmap_t =block maps are in-memory representation of the per-datastore bitmaps whether blocks are used or free. Changes to block maps are done in a transactional way. One can finally get the accumulated updates of a transaction for writing them out to the dbobject..end
method active : booldatastore
table. If the object is inactive, the other methods (except id
and identity) will fail with Inactive.method id : intmethod identity : stringmethod size : int64method n_used : int64method n_trans : int64method n_free : int64method fill_blockmap : int64 -> string -> unitfill_blockmap index data: Fills the blockmap at index
with data, a string consisting of 0 and 1. index must be
a multiple of 1024. (This is only allowed once per row for init,
and is outside any transaction.)method has_free_blocks : boolmethod reserve : int -> < > -> int64 listreserve n owner: finds n free blocks and returns their indices.
The reservation is owned by owner, an arbitrary object.
Reserved blocks are one of two forms of transitional blocks.
Reserved blocks are turned into used blocks at commit time,
and freed again on abort.method free : int64 list -> < > -> unitfree l owner: deallocates these blocks. If they are still
only reserved but not yet committed, they keep their reserved
status until commit time, and are freed only then. It is
allowed to free kept blocks.method keep : int64 list -> < > -> unitkeep l owner: marks these blocks as "to keep" even if a
competing transaction frees them. Kept blocks are the other
form of transitional blocks. They are counted in n_used as
long as there is no committed free. They are counted in
n_trans when there is a committed free. In the latter
case, the blocks are turned into free blocks at commit or abort
time. It is not allowed to keep blocks when there was already
a free for them in the same transaction, or a competing
transaction could free the block and commit that.
Kept blocks are not entered into the db, so it is not required
to get_changes.
method commit : < > -> unitcommit owner: commits owner's reservations, and makes them
permanent. If owner is unknown this is a no-op.method rollback : < > -> unitrollback owner: unreserves owner's blocks. If owner is unknown
this is a no-op.method get_changes : < > -> (int64 * string) listget_changes owner: Returns the changes made by owner.
This is a list of database rows (start_index,row_data),
to be used for SQL UPDATEs. If owner is unknown, the empty
list is returned.method inactivate : unit -> unitactive to falsemethod dump : string