Commit 5683c3ca authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c5d4e890
......@@ -457,6 +457,23 @@ func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (
*/
// zodbCacheControl tunes ZODB wrt caching XXX
// XXX set it to Connection.CacheControl
type zodbCacheControl struct {}
type (cc *zodbCacheControl) WantEvict(obj Object) {
// we want to keep ZBTree/ZBucket always alive becuse it is essentially
// the index where to find ZBigFile data.
switch obj.(type) {
default:
return true
case *ZBtree:
case *ZBucket:
}
return false
}
// XXX option to prevent starting if wcfs was already started ?
......
......@@ -105,6 +105,15 @@ func (pyobj *pyObject) PyClass() pickle.Class { return pyobj.pyclass }
func (pyobj *pyObject) PyState() interface{} { return pyobj.pystate }
// ConnCacheControl is the interface that allows applications to influence
// Connection decisions with respect to its cache.
type ConnCacheControl interface {
// WantEvict is called when object is going to be evicted from live cache and made ghost.
// If !ok the object will remain live.
WantEvict(obj Object) (ok bool)
}
// Connection represents a view of ZODB database.
//
// The view is representing state of ZODB objects as of `at` transaction.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment