Description |
BForests are dictionary-like objects that use multiple BTrees for a backend and support
rotation of the composite trees. This supports various implementations of timed member
expirations, enabling caches and semi-persistent storage. A useful and simple subclass
would be to promote a key-value pair to the first (newest) bucket whenever the key is
accessed, for instance. It also is useful with disabling the rotation capability.
Like btrees, bforests come in four flavors: Integer-Integer (IIBForest), Integer-Object
(IOBForest), Object-Integer (OIBForest), and Object-Object (OOBForest). The examples here
will deal with them in the abstract: we will create classes from the imaginary and
representative BForest class, and generate keys from KeyGenerator and values from
ValueGenerator. From the examples you should be able to extrapolate usage of all four
types.
|