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
bc1b465f
Commit
bc1b465f
authored
Jun 19, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
57b00793
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
wcfs/δbtail.go
wcfs/δbtail.go
+25
-3
No files found.
wcfs/δbtail.go
View file @
bc1b465f
...
...
@@ -233,6 +233,11 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags Track
panic
(
"empty path"
)
}
treeRoot
:=
path
[
0
]
.
(
*
Tree
)
var
leafBucket
*
Bucket
if
l
:=
len
(
path
);
l
>
1
{
leafBucket
=
path
[
l
-
1
]
.
(
*
Bucket
)
}
// XXX assert Tree Tree ... Tree Bucket
root
:=
treeRoot
.
POid
()
...
...
@@ -241,11 +246,13 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags Track
fmt
.
Printf
(
"Track %v
\n
"
,
oidv
)
parent
:=
zodb
.
InvalidOid
var
track
nodeTrack
var
oldTrack
bool
for
_
,
node
:=
range
path
{
oid
:=
node
.
POid
()
// XXX check for InvalidOid (e.g. T/B1:a with bucket not having its own oid.
track
,
o
k
:
=
δBtail
.
trackIdx
[
oid
]
if
!
ok
{
track
,
o
ldTrack
=
δBtail
.
trackIdx
[
oid
]
if
!
o
ldTrac
k
{
track
=
nodeTrack
{
parent
:
parent
,
trackedKeys
:
SetKey
{}}
δBtail
.
trackIdx
[
oid
]
=
track
// XXX .trackNew += oid
...
...
@@ -256,12 +263,27 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags Track
oid
,
track
.
parent
,
parent
)
}
if
track
.
trackedKeys
!=
nil
{
// root always covers [-∞, ∞)
// XXX add all keys of leaf bucket XXX for bucket _and_ back for parents
track
.
trackedKeys
.
Add
(
key
)
}
parent
=
oid
}
// tracked += all keys of leaf bucket for every node up to the root
if
!
oldTrack
&&
leafBucket
!=
nil
{
bkeys
:=
SetKey
{}
for
_
,
__
:=
range
leafBucket
.
Entryv
()
{
bkeys
.
Add
(
__
.
Key
())
}
for
{
track
.
trackedKeys
.
Update
(
bkeys
)
if
track
.
parent
==
zodb
.
InvalidOid
{
break
}
track
=
δBtail
.
trackIdx
[
track
.
parent
]
}
}
_
,
ok
:=
δBtail
.
byRoot
[
root
]
if
!
ok
{
δBtail
.
byRoot
[
root
]
=
newΔTtail
()
...
...
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