Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
f295ddd8
Commit
f295ddd8
authored
Jul 19, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
753d82f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
wcfs/zodb.go
wcfs/zodb.go
+9
-10
No files found.
wcfs/zodb.go
View file @
f295ddd8
...
@@ -22,8 +22,6 @@ import (
...
@@ -22,8 +22,6 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
"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.
// Object is the interface that every in-RAM object representing any ZODB object implements.
type
Object
interface
{
type
Object
interface
{
PJar
()
*
Connection
// Connection this in-RAM object is part of.
PJar
()
*
Connection
// Connection this in-RAM object is part of.
...
@@ -83,7 +81,7 @@ type Object interface {
...
@@ -83,7 +81,7 @@ type Object interface {
PInvalidate
()
PInvalidate
()
}
}
// ObjectState describe state of in-RAM object.
// ObjectState describe
s
state of in-RAM object.
type
ObjectState
int
type
ObjectState
int
const
(
const
(
...
@@ -126,7 +124,7 @@ type loadState struct {
...
@@ -126,7 +124,7 @@ type loadState struct {
// exchanged as raw bytes.
// exchanged as raw bytes.
type
Stateful
interface
{
type
Stateful
interface
{
// DropState should discard in-RAM object state.
// DropState should discard in-RAM object state.
// XXX move out of Stateful?
// XXX move out of Stateful?
-> Ghostable?
DropState
()
DropState
()
// SetState should set state of the in-RAM object from raw data.
// SetState should set state of the in-RAM object from raw data.
...
@@ -209,10 +207,15 @@ type Connection struct {
...
@@ -209,10 +207,15 @@ type Connection struct {
}
}
// LiveCacheControl is the interface that allows applications to influence
// LiveCacheControl is the interface that allows applications to influence
// Connection's decisions with respect to
it
s live cache.
// Connection's decisions with respect to
Connection'
s live cache.
type
LiveCacheControl
interface
{
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.
// If !ok the object will remain live.
//
// NOTE on invalidation invalidated objects are evicted from live cache
// unconditionally.
WantEvict
(
obj
Object
)
(
ok
bool
)
WantEvict
(
obj
Object
)
(
ok
bool
)
}
}
...
@@ -250,10 +253,6 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
...
@@ -250,10 +253,6 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
// do the loading outside of obj lock
// do the loading outside of obj lock
state
,
serial
,
err
:=
obj
.
jar
.
load
(
ctx
,
obj
.
oid
)
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
// relock the object
obj
.
mu
.
Lock
()
obj
.
mu
.
Lock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment