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
3c207b7c
Commit
3c207b7c
authored
Jun 22, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3422fba8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
wcfs/δbtail.go
wcfs/δbtail.go
+33
-0
No files found.
wcfs/δbtail.go
View file @
3c207b7c
...
...
@@ -77,6 +77,7 @@ import (
"fmt"
"math"
"reflect"
"sort"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/neo/go/transaction"
...
...
@@ -496,6 +497,38 @@ func (δBtail *ΔBtail) δZConnectTracked(δZv *zodb.EventCommit) (δZTC SetOid,
return
δZTC
,
δtopsByRoot
}
// XXX place
// nodeInRange represents a Node coming under [lo, hi_] key range in its tree.
type
nodeInRange
struct
{
lo
,
hi_
Key
// [lo, hi_] NOTE _not_ hi) not to overflow at ∞
node
Node
}
// rangeCover represents set of nodes covering a range.
// nodes come with key↑ and not intersection [lo,hi)
type
rangeCover
[]
*
nodeInRange
// key↑
// Get returns node covering key k.
// Get panics if k is outside covered range.
func
(
rc
rangeCover
)
Get
(
k
Key
)
*
nodeInRange
{
i
:=
sort
.
Search
(
len
(
rc
),
func
(
i
int
)
bool
{
return
k
<=
rc
[
i
]
.
hi_
})
if
i
==
len
(
rc
)
{
panicf
(
"key %v not covered"
,
k
)
// XXX + coverage: ...
}
rn
:=
rc
[
i
]
if
!
(
rn
.
lo
<=
k
&&
k
<=
rn
.
hi_
)
{
panicf
(
"BUG: get(%v) -> [%v, %v]"
,
k
,
rn
.
lo
,
rn
.
hi_
)
}
return
rn
}
// treediff computes δT for tree specified by root in between old..new.
//
// δtops is set of top nodes for changed subtrees.
...
...
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