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
22226d99
Commit
22226d99
authored
Sep 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
dc40c397
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+6
-5
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+4
-4
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
22226d99
...
...
@@ -227,6 +227,7 @@ func vδTClone(orig []ΔTree) []ΔTree {
func
(
δBtail
*
ΔBtail
)
Head
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Head
()
}
func
(
δBtail
*
ΔBtail
)
Tail
()
zodb
.
Tid
{
return
δBtail
.
δZtail
.
Tail
()
}
// Track adds tree path to tracked set.
//
// path[0] signifies tree root.
...
...
@@ -550,7 +551,8 @@ func (δTtail *_ΔTtail) rebuild1(atPrev zodb.Tid, δZ zodb.ΔRevEntry, trackNew
return
δtrack
,
δtkeycov
,
newRevEntry
,
nil
}
// Update updates δB with per-object-level ZODB changes.
// Update updates δB with object-level ZODB changes.
//
// Only those objects from δZ that belong to tracked set are guaranteed to be
// taken into account. In other words a tree history will assuredly include
...
...
@@ -620,7 +622,6 @@ type _ΔBUpdate1 struct {
}
type
_ΔTUpdate1
struct
{
δtkeycov1
*
blib
.
RangedKeySet
// {} root -> δtrackedKeys after first treediff (always grow)
δtrack
*
blib
.
ΔPPTreeSubSet
// XXX kill (not used)
}
func
(
δBtail
*
ΔBtail
)
_Update1
(
δZ
*
zodb
.
EventCommit
)
(
δB1
_ΔBUpdate1
,
err
error
)
{
headOld
:=
δBtail
.
Head
()
...
...
@@ -680,7 +681,7 @@ func (δBtail *ΔBtail) _Update1(δZ *zodb.EventCommit) (δB1 _ΔBUpdate1, err e
}
δBtail
.
trackSet
.
ApplyΔ
(
δtrack
)
δB1
.
ByRoot
[
root
]
=
&
_ΔTUpdate1
{
δtkeycov1
:
δtkeycov
,
δtrack
:
δtrack
}
δB1
.
ByRoot
[
root
]
=
&
_ΔTUpdate1
{
δtkeycov1
:
δtkeycov
}
}
return
δB1
,
nil
...
...
@@ -866,14 +867,14 @@ func (δBtail *ΔBtail) SliceByRootRev(root zodb.Oid, lo, hi zodb.Tid) /*readonl
return
nil
}
// find max j : [j].rev ≤ hi
XXX linear scan ->
binary search
// find max j : [j].rev ≤ hi
linear scan -> TODO
binary search
j
:=
l
-
1
for
;
j
>=
0
&&
vδT
[
j
]
.
Rev
>
hi
;
j
--
{}
if
j
<
0
{
return
nil
// ø
}
// find max i : [i].rev > lo
XXX linear scan ->
binary search
// find max i : [i].rev > lo
linear scan -> TODO
binary search
i
:=
j
for
;
i
>=
0
&&
vδT
[
i
]
.
Rev
>
lo
;
i
--
{}
i
++
...
...
wcfs/internal/zdata/δftail.go
View file @
22226d99
...
...
@@ -287,11 +287,11 @@ func (δFtail *ΔFtail) rebuildAll() (err error) {
return
nil
}
// rebuildIfNeeded rebuilds vδE if there is such need.
// rebuild
1
IfNeeded rebuilds vδE if there is such need.
//
// it returns corresponding δftail for convenience.
// the only case when vδE actually needs to be rebuilt is when the file just started to be tracked.
func
(
δFtail
*
ΔFtail
)
rebuildIfNeeded
(
foid
zodb
.
Oid
)
(
_
*
_ΔFileTail
,
err
error
)
{
func
(
δFtail
*
ΔFtail
)
rebuild
1
IfNeeded
(
foid
zodb
.
Oid
)
(
_
*
_ΔFileTail
,
err
error
)
{
// XXX locking
δftail
:=
δFtail
.
byFile
[
foid
]
...
...
@@ -604,7 +604,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δFile ────────o───────o──────x─────x────────────────────────
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
foid
)
δftail
,
err
:=
δFtail
.
rebuild
1
IfNeeded
(
foid
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
...
...
@@ -848,7 +848,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
// XXX locking
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
foid
)
δftail
,
err
:=
δFtail
.
rebuild
1
IfNeeded
(
foid
)
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
false
,
err
}
...
...
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