[elephant-devel] FYI

Ian Eslick eslick at csail.mit.edu
Thu Apr 12 17:17:03 UTC 2007


This is a notice of a few little additions and an invitation to  
comment if anyone is so inclined.

Persistent Sets (src/elephant/pset.lisp)
----------------------------------------

I added a simple persistent set class, pset, to Elephant.  Currently  
there is a default implementation based on btrees, but a backend  
could easily override it to implement something more efficient.  This  
API may be tweaked prior to 1.0 so consider it a beta feature.

Snapshot Sets for Standard Classes (src/contrib/eslick/snapshot-db.lisp)
------------------------------------------------------------------------

I wrote a small datastructure the other day called snapshot-set as an  
example for the scenarios chapter of the new manual.  A snapshot-set  
is a simple mechanism for persisting sets of standard objects and  
hash tables by adding objects to a set and loading/unloading the  
objects as a class including reconstructing all the pointers properly.

There are some restrictions that a user would need to keep track of:

- Contamination: any standard object referred to in a hash-table or  
standard-object is automatically pulled into the set
- Supported aggregates: Only hash tables can be members of a set,  
arrays, lists, etc are not allowed
- Maximum set size: Snapshots are currently limited by the maximum  
size of a transaction

If you have a graph, you can just add the node to the root of a set  
and the whole graph will get saved.  Update it at full in-memory  
speed and when you're done, just call snapshot on the set object and  
the persistent store is updated.  The set update operation is  
transaction protected, so other threads can call restore and see the  
last coherent state.

Ian




More information about the elephant-devel mailing list