ZODB: more flexible cache interface

Bug #143566 reported by Dieter Maurer on 2005-11-14
Affects Status Importance Assigned to Milestone

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

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.non_ghost_objects" directly, some functions are
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.

Dieter Maurer (d.maurer) wrote :
Dieter Maurer (d.maurer) wrote :

Uploaded: cache_flex_int2.pat

Improved interface (facilitating delegation and subclassing)

affects: zope2 → zodb
Jim Fulton (jim-zope) wrote :

I plan a major reworking of persistence to provide, among other things,
more pluggable caching.

Changed in zodb:
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers