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
fc5deb55
Commit
fc5deb55
authored
Jun 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4f6d5caf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
wcfs/δbtail.go
wcfs/δbtail.go
+6
-1
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+2
-2
wcfs/δftail.go
wcfs/δftail.go
+2
-1
No files found.
wcfs/δbtail.go
View file @
fc5deb55
...
...
@@ -116,6 +116,9 @@ type ΔBtail struct {
// tracked objects that are not yet taken into account in current δBtail
trackNew
SetOid
// tracked keys that are not in current version of the tree.
tkdel
SetKey
}
// ΔB represents a change in BTrees space.
...
...
@@ -203,7 +206,7 @@ const (
// XXX TrackMinKey (we don't need it in WCFS)
)
func
(
δBtail
*
ΔBtail
)
Track
(
path
[]
Node
,
flags
TrackFlags
)
{
// XXX Tree|Bucket; path[0] = root
func
(
δBtail
*
ΔBtail
)
Track
(
key
Key
,
keyPresent
bool
,
path
[]
Node
,
flags
TrackFlags
)
{
// XXX Tree|Bucket; path[0] = root
l
:=
len
(
path
)
if
l
==
0
{
panic
(
"empty path"
)
...
...
@@ -244,6 +247,8 @@ func (δBtail *ΔBtail) Track(path []Node, flags TrackFlags) { // XXX Tree|Bucke
// only those keys, that correspond to tracked subset of δZ.
//
// δZ should include all objects changed by ZODB transaction.
//
// XXX optionally accept zconnOld/zconnNew from client
func
(
δBtail
*
ΔBtail
)
Update
(
δZ
*
zodb
.
EventCommit
)
(
_
ΔB
,
err
error
)
{
headOld
:=
δBtail
.
Head
()
defer
xerr
.
Contextf
(
&
err
,
"ΔBtail update %s -> %s"
,
headOld
,
δZ
.
Tid
)
...
...
wcfs/δbtail_test.go
View file @
fc5deb55
...
...
@@ -529,7 +529,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
kadjTracked
=
SetKey
{}
// kadj[Tracked] (all keys adjacent to tracked keys)
for
k
:=
range
initialTrackedKeys
{
path
:=
[]
Node
{}
_
,
_
,
err
=
ztree
.
VGet
(
ctx
,
k
,
func
(
node
Node
)
{
_
,
ok
,
err
:
=
ztree
.
VGet
(
ctx
,
k
,
func
(
node
Node
)
{
path
=
append
(
path
,
node
)
});
X
(
err
)
...
...
@@ -538,7 +538,7 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
if
k
==
kInf
{
trackFlags
=
TrackMaxKey
}
δbtail
.
Track
(
path
,
trackFlags
)
δbtail
.
Track
(
k
,
ok
,
path
,
trackFlags
)
kadjTracked
.
Update
(
kadj
[
k
])
}
...
...
wcfs/δftail.go
View file @
fc5deb55
...
...
@@ -139,9 +139,10 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
blk
int64
,
path
[]
btree
.
LONode
,
zblk
zBlk
)
{
δbTrackFlags
:=
TrackFlags
(
0
)
if
blk
==
-
1
{
// XXX blk = ∞ ?
δbTrackFlags
=
TrackMaxKey
}
δFtail
.
δBtail
.
Track
(
path
,
δbTrackFlags
)
δFtail
.
δBtail
.
Track
(
blk
,
zblk
!=
nil
,
path
,
δbTrackFlags
)
root
:=
path
[
0
]
.
(
*
btree
.
LOBTree
)
files
,
ok
:=
δFtail
.
fileIdx
[
root
.
POid
()]
if
!
ok
{
...
...
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