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
d37f8481
Commit
d37f8481
authored
Sep 22, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fc8e10e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+12
-6
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+1
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
d37f8481
...
@@ -61,7 +61,7 @@ const debugΔBtail = false
...
@@ -61,7 +61,7 @@ const debugΔBtail = false
// .Track(path) - start tracking tree nodes and keys; root=path[0], keys=path[-1].(lo,hi]
// .Track(path) - start tracking tree nodes and keys; root=path[0], keys=path[-1].(lo,hi]
//
//
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes
past
revCut
// .ForgetPast(revCut) - forget changes
≤
revCut
// .SliceByRev(lo, hi) -> []δB - query for all trees changes with rev ∈ (lo, hi]
// .SliceByRev(lo, hi) -> []δB - query for all trees changes with rev ∈ (lo, hi]
// .SliceByRootRev(root, lo, hi) -> []δT - query for changes of a tree with rev ∈ (lo, hi]
// .SliceByRootRev(root, lo, hi) -> []δT - query for changes of a tree with rev ∈ (lo, hi]
// .GetAt(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
// .GetAt(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
...
@@ -92,12 +92,12 @@ type ΔBtail struct {
...
@@ -92,12 +92,12 @@ type ΔBtail struct {
// taken into account, is kept in _ΔTtail.trackNew & co.
// taken into account, is kept in _ΔTtail.trackNew & co.
trackSet
blib
.
PPTreeSubSet
trackSet
blib
.
PPTreeSubSet
// set of trees for which .trackNew is non-empty
// set of trees for which
_ΔTtail
.trackNew is non-empty
trackNewRoots
setOid
trackNewRoots
setOid
// handle to make connections to access database.
// handle to make connections to access database.
// TODO allow client to optionally provide zconnOld/zconnNew on e.g. Update()
// TODO allow client to optionally provide zconnOld/zconnNew on e.g. Update()
db
*
zodb
.
DB
// to open connections to load new/old tree|buckets
db
*
zodb
.
DB
// to open connections to load new/old tree|buckets
}
}
// _ΔTtail represent tail of revisional changes to one BTree.
// _ΔTtail represent tail of revisional changes to one BTree.
...
@@ -128,7 +128,7 @@ type ΔB struct {
...
@@ -128,7 +128,7 @@ type ΔB struct {
// ΔTree describes changes to one BTree in one revision.
// ΔTree describes changes to one BTree in one revision.
type
ΔTree
struct
{
type
ΔTree
struct
{
Rev
zodb
.
Tid
Rev
zodb
.
Tid
KV
map
[
Key
]
ΔValue
KV
map
[
Key
]
ΔValue
}
}
...
@@ -237,8 +237,6 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) {
...
@@ -237,8 +237,6 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) {
// NOTE key not needed for anything besides tracing
// NOTE key not needed for anything besides tracing
// (tracking set will be added with all keys, covered by leaf keyrange)
// (tracking set will be added with all keys, covered by leaf keyrange)
// XXX assert node.PJar().At() == .Head()
path
:=
nodePathToPath
(
nodePath
)
path
:=
nodePathToPath
(
nodePath
)
if
traceΔBtail
{
if
traceΔBtail
{
...
@@ -248,6 +246,14 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) {
...
@@ -248,6 +246,14 @@ func (δBtail *ΔBtail) Track(key Key, nodePath []Node) {
tracefΔBtail
(
"trackSet: %s
\n
"
,
δBtail
.
trackSet
)
// XXX locking
tracefΔBtail
(
"trackSet: %s
\n
"
,
δBtail
.
trackSet
)
// XXX locking
}
}
head
:=
δBtail
.
Head
()
for
_
,
node
:=
range
nodePath
{
nodeAt
:=
node
.
PJar
()
.
At
()
if
nodeAt
!=
head
{
panicf
(
"node.at (@%s) != δBtail.head (@%s)"
,
nodeAt
,
head
)
}
}
δBtail
.
track
(
key
,
path
)
δBtail
.
track
(
key
,
path
)
}
}
...
...
wcfs/internal/zdata/δftail.go
View file @
d37f8481
...
@@ -104,7 +104,7 @@ type setOid = set.Oid
...
@@ -104,7 +104,7 @@ type setOid = set.Oid
// .Track(file, blk, path, zblk) - add file and block reached via BTree path to tracked set.
// .Track(file, blk, path, zblk) - add file and block reached via BTree path to tracked set.
//
//
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes
past
revCut
// .ForgetPast(revCut) - forget changes
≤
revCut
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
// .SliceByFileRev(file, lo, hi) -> []δfile - query for changes of a file with rev ∈ (lo, hi]
// .SliceByFileRev(file, lo, hi) -> []δfile - query for changes of a file with rev ∈ (lo, hi]
// .BlkRevAt(file, #blk, at) - query for what is last revision that changed
// .BlkRevAt(file, #blk, at) - query for what is last revision that changed
...
...
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