ZODB: more flexible cache interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
New
|
Wishlist
|
Unassigned |
Bug Description
Currently, "cPersistance.c" and "cPickleCache.c" are quite tightly bound:
"cPickleCache.c" knows the complete "cPersistentObject" internals
while "cPersistence.c" knows the cache's ring and its number of non ghost
objects. This tight binding makes it difficult to implement other cache
schemes.
Currently, I need to share a common cache among all mounted connections.
Future plans are cache replacement strategies that take approximations
of object size into account.
The attached patch replaces the cache interface for "cPersistence"
by a method based API. Rather than directly using "Cache.ring_home"
and "Cache.
called: "[un]ghostify", "access", "is_ghost", "unreferenced".
This not only provides more flexibility but is also more readable
and maintainable. On the other hand, it is slightly less efficient.
affects: | zope2 → zodb |
Uploaded: cache_flex_int2.pat
Improved interface (facilitating delegation and subclassing)