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
74fc8bb8
Commit
74fc8bb8
authored
Jun 23, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0700f488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
wcfs/δbtail.go
wcfs/δbtail.go
+7
-7
No files found.
wcfs/δbtail.go
View file @
74fc8bb8
...
@@ -513,10 +513,10 @@ type rangeSplit []*nodeInRange // key↑
...
@@ -513,10 +513,10 @@ type rangeSplit []*nodeInRange // key↑
// Get panics if k is not covered.
// Get panics if k is not covered.
func
(
rs
rangeSplit
)
Get
(
k
Key
)
*
nodeInRange
{
func
(
rs
rangeSplit
)
Get
(
k
Key
)
*
nodeInRange
{
rnode
,
ok
:=
rs
.
Get_
(
k
)
rnode
,
ok
:=
rs
.
Get_
(
k
)
if
ok
{
if
!
ok
{
return
rnode
panicf
(
"key %v not covered"
,
k
)
}
}
panicf
(
"key %v not covered"
,
k
)
return
rnode
}
}
// Get_ returns node covering key k.
// Get_ returns node covering key k.
...
@@ -528,12 +528,12 @@ func (rs rangeSplit) Get_(k Key) (rnode *nodeInRange, ok bool) {
...
@@ -528,12 +528,12 @@ func (rs rangeSplit) Get_(k Key) (rnode *nodeInRange, ok bool) {
return
nil
,
false
// key not covered
return
nil
,
false
// key not covered
}
}
rn
=
rs
[
i
]
rn
:
=
rs
[
i
]
if
!
(
rn
.
lo
<=
k
&&
k
<=
rn
.
hi_
)
{
if
!
(
rn
.
lo
<=
k
&&
k
<=
rn
.
hi_
)
{
panicf
(
"BUG: get(%v) -> %s"
,
k
,
rn
)
panicf
(
"BUG: get(%v) -> %s"
,
k
,
rn
)
}
}
return
rn
return
rn
,
true
}
}
// Expand replaces rnode with its children.
// Expand replaces rnode with its children.
...
@@ -558,7 +558,7 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
...
@@ -558,7 +558,7 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
// [len(ev)].Key = +∞ ; should be assumed so
// [len(ev)].Key = +∞ ; should be assumed so
tree
:=
rnode
.
node
.
(
*
Tree
)
tree
:=
rnode
.
node
.
(
*
Tree
)
treev
:=
tree
.
Entryv
()
treev
:=
tree
.
Entryv
()
children
:
=
make
(
rangeSplit
,
0
,
len
(
treev
)
+
1
)
children
=
make
(
rangeSplit
,
0
,
len
(
treev
)
+
1
)
for
i
:=
range
treev
{
for
i
:=
range
treev
{
lo
:=
rnode
.
lo
lo
:=
rnode
.
lo
if
i
>
0
{
if
i
>
0
{
...
@@ -580,7 +580,7 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
...
@@ -580,7 +580,7 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
// GetToBucket returns bucket corresponding to key k.
// GetToBucket returns bucket corresponding to key k.
// While reaching to that bucket, it expands step-by-step trees that are leading to that bucket.
// While reaching to that bucket, it expands step-by-step trees that are leading to that bucket.
// XXX also return path?
// XXX also return path?
func
(
prs
*
rangeSplit
)
GetToBucket
(
ctx
,
k
)
(
rbucket
*
nodeInRange
,
bool
ok
,
err
error
)
{
func
(
prs
*
rangeSplit
)
GetToBucket
(
ctx
context
.
Context
,
k
Key
)
(
rbucket
*
nodeInRange
,
ok
bool
,
err
error
)
{
rnode
,
ok
:=
prs
.
Get_
(
k
)
rnode
,
ok
:=
prs
.
Get_
(
k
)
if
!
ok
{
if
!
ok
{
return
nil
,
false
,
nil
// key not covered
return
nil
,
false
,
nil
// key not covered
...
...
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