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
0cd6ed95
Commit
0cd6ed95
authored
Jun 24, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
50bc3b82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
wcfs/δbtail.go
wcfs/δbtail.go
+10
-8
No files found.
wcfs/δbtail.go
View file @
0cd6ed95
...
...
@@ -189,7 +189,7 @@ type ΔBtail struct {
type
nodeTrack
struct
{
parent
zodb
.
Oid
// parent node | InvalidOid for root
holes
SetKey
// missing keys tracked under this node XXX nil for root(?) XXX only !empty root
trackedKeys
SetKey
// XXX kill
//
trackedKeys SetKey // XXX kill
}
// ΔB represents a change in BTrees space.
...
...
@@ -279,7 +279,6 @@ const (
// XXX TrackMinKey (we don't need it in WCFS)
)
// XXX kill keyPresent?
// XXX keep in trackedKeys only keys that are not present in btree - i.e. only negative entries
// -> this requires to merge δc returned by diffT and adjust bChildren to tail into
// -> it will use less memory and offload Track from (re)loading leaf bucket
...
...
@@ -310,7 +309,7 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
// XXX check for InvalidOid (e.g. T/B1:a with bucket not having its own oid.
track
,
oldTrack
=
δBtail
.
trackIdx
[
oid
]
if
!
oldTrack
{
track
=
nodeTrack
{
parent
:
parent
,
holes
:
SetKey
{}
,
trackedKeys
:
SetKey
{}}
track
=
nodeTrack
{
parent
:
parent
,
holes
:
SetKey
{}
}
δBtail
.
trackIdx
[
oid
]
=
track
// XXX .trackNew += oid
}
...
...
@@ -319,9 +318,6 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
panicf
(
"node %s is reachable from multiple parents: %s %s"
,
oid
,
track
.
parent
,
parent
)
}
if
track
.
trackedKeys
!=
nil
{
// root always covers [-∞, ∞)
track
.
trackedKeys
.
Add
(
key
)
}
parent
=
oid
}
...
...
@@ -366,6 +362,7 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
}
fmt
.
Printf
(
" bkeys: %s
\n
"
,
bkeys
)
/*
for {
track.trackedKeys.Update(bkeys)
if track.parent == zodb.InvalidOid {
...
...
@@ -373,6 +370,7 @@ func (δBtail *ΔBtail) Track(ctx context.Context, key Key, keyPresent bool, pat
}
track = δBtail.trackIdx[track.parent]
}
*/
}
...
...
@@ -1051,6 +1049,7 @@ func δMerge(δ, δ2 map[Key]ΔValue) error {
/*
func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]nodeTrack) (δ map[Key]ΔValue, err error) {
fmt.Printf(" T %s %s\n", xidOf(a), xidOf(b))
defer xerr.Contextf(&err, "diffT %s %s", xidOf(a), xidOf(b))
...
...
@@ -1084,7 +1083,7 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
child := __.Child()
coid := child.POid()
if δZTC.Has(coid) ||
(
len
(
av
)
==
1
&&
coid
==
zodb
.
InvalidOid
)
/* embedded bucket */
{
(len(av) == 1 && coid == zodb.InvalidOid)
{ // embedded bucket
{
aChildren[coid] = child
}
}
...
...
@@ -1199,6 +1198,7 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
}
*/
/*
allChildren := SetOid{}
...
...
@@ -1277,8 +1277,10 @@ func __diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oi
}
*/
/*
return δ, nil
}
*/
// diffB computes difference in between two buckets.
// see diffX for details.
...
...
@@ -1528,5 +1530,5 @@ func (rn nodeInRange) String() string {
}
func
(
track
nodeTrack
)
String
()
string
{
return
fmt
.
Sprintf
(
"{p%s h%s
k%s}"
,
track
.
parent
,
track
.
holes
,
track
.
trackedKey
s
)
return
fmt
.
Sprintf
(
"{p%s h%s
}"
,
track
.
parent
,
track
.
hole
s
)
}
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