Commit f295ddd8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 753d82f5
......@@ -22,8 +22,6 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
)
// XXX make methods private, e.g. _pJar ?
// Object is the interface that every in-RAM object representing any ZODB object implements.
type Object interface {
PJar() *Connection // Connection this in-RAM object is part of.
......@@ -83,7 +81,7 @@ type Object interface {
PInvalidate()
}
// ObjectState describe state of in-RAM object.
// ObjectState describes state of in-RAM object.
type ObjectState int
const (
......@@ -126,7 +124,7 @@ type loadState struct {
// exchanged as raw bytes.
type Stateful interface {
// DropState should discard in-RAM object state.
// XXX move out of Stateful?
// XXX move out of Stateful? -> Ghostable?
DropState()
// SetState should set state of the in-RAM object from raw data.
......@@ -209,10 +207,15 @@ type Connection struct {
}
// LiveCacheControl is the interface that allows applications to influence
// Connection's decisions with respect to its live cache.
// Connection's decisions with respect to Connection's live cache.
type LiveCacheControl interface {
// WantEvict is called when object is going to be evicted from live cache and made ghost.
// WantEvict is called when object is going to be evicted from live
// cache on deactivation and made ghost.
//
// If !ok the object will remain live.
//
// NOTE on invalidation invalidated objects are evicted from live cache
// unconditionally.
WantEvict(obj Object) (ok bool)
}
......@@ -250,10 +253,6 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
// do the loading outside of obj lock
state, serial, err := obj.jar.load(ctx, obj.oid)
if err == nil {
err = obj.instance.SetState(state) // XXX err ctx
state.Release()
}
// relock the object
obj.mu.Lock()
......
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