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
700f6028
Commit
700f6028
authored
Oct 07, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ca074426
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+10
-13
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+1
-1
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+1
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
700f6028
...
...
@@ -34,7 +34,7 @@ package xbtree
//
// Because it is very computationally expensive(+) to find out for an object to
// which BTree it belongs, ΔBtail cannot provide full BTree-level history given
// just ΔZtail with δZ changes.
Because of
this ΔBtail requires help from
// just ΔZtail with δZ changes.
Due to
this ΔBtail requires help from
// users, which are expected to call ΔBtail.Track(treepath) to let ΔBtail know
// that such and such ZODB objects constitute a path from root of a tree to some
// of its leaf. After Track call the objects from the path and tree keys, that
...
...
@@ -310,18 +310,15 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// Track adds tree path to tracked set.
//
// path[0] signifies tree root.
// All path elements must be Tree except last one which, for non-empty tree, must be Bucket.
// path[-1] signifies leaf node.
// keycov should be key range covered by the leaf node.
//
// Besides key (which might point to value or hole), δBtail will also track all XXX
// keys covered by leaf node. In particular after request for KeyMax or KeyMin
// to be tracked, δBtail will keep on tracking changes to maximum or minimum
// keys correspondingly.
// ΔBtail will start tracking provided tree nodes and keys ∈ keycov.
//
// Objects in path must be with .PJar().At() == .Head()
func
(
δBtail
*
ΔBtail
)
Track
(
keycov
KeyRange
,
nodePath
[]
Node
)
{
// NOTE key not needed for anything besides tracing XXX kill comment
// (tracking set will be added with all keys, covered by leaf keyrange)
// All path elements must be Tree except last one which, for non-empty tree, must be Bucket.
//
// Objects in the path must be with .PJar().At() == .Head()
func
(
δBtail
*
ΔBtail
)
Track
(
nodePath
[]
Node
,
keycov
KeyRange
)
{
if
traceΔBtail
{
pathv
:=
[]
string
{}
for
_
,
node
:=
range
nodePath
{
pathv
=
append
(
pathv
,
vnode
(
node
))
}
...
...
@@ -338,7 +335,7 @@ func (δBtail *ΔBtail) Track(keycov KeyRange, nodePath []Node) {
}
path
:=
nodePathToPath
(
nodePath
)
δBtail
.
track
(
keycov
,
path
)
δBtail
.
track
(
path
,
keycov
)
}
// nodePathToPath converts path from []Node to []Oid.
...
...
@@ -366,7 +363,7 @@ func nodePathToPath(nodePath []Node) (path []zodb.Oid) {
return
path
}
func
(
δBtail
*
ΔBtail
)
track
(
keycov
KeyRange
,
path
[]
zodb
.
Oid
)
{
func
(
δBtail
*
ΔBtail
)
track
(
path
[]
zodb
.
Oid
,
keycov
KeyRange
)
{
// XXX locking
// first normalize path: remove embedded bucket and check if it was an
...
...
wcfs/internal/xbtree/δbtail_test.go
View file @
700f6028
...
...
@@ -1768,7 +1768,7 @@ func trackKeys(δbtail *ΔBtail, t *xbtreetest.Commit, keys setKey) {
// tracking set. By aligning initial state to the same as after
// T1->ø, we test what will happen on ø->T2.
b
:=
t
.
Xkv
.
Get
(
k
)
δbtail
.
track
(
b
.
Keycov
,
b
.
Path
()
)
δbtail
.
track
(
b
.
Path
(),
b
.
Keycov
)
}
}
...
...
wcfs/internal/zdata/δftail.go
View file @
700f6028
...
...
@@ -225,7 +225,7 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, bl
// if blk == -1 {
// blk = xbtree.KeyMax
// }
δFtail
.
δBtail
.
Track
(
blkcov
,
path
)
δFtail
.
δBtail
.
Track
(
path
,
blkcov
)
rootObj
:=
path
[
0
]
.
(
*
btree
.
LOBTree
)
root
:=
rootObj
.
POid
()
...
...
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