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
2370caa6
Commit
2370caa6
authored
Oct 12, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5b30965f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
9 deletions
+15
-9
wcfs/internal/xbtree/blib/rangemap.go.in
wcfs/internal/xbtree/blib/rangemap.go.in
+1
-0
wcfs/internal/xbtree/blib/zrangemap_str.go
wcfs/internal/xbtree/blib/zrangemap_str.go
+1
-0
wcfs/internal/xbtree/blib/zrangemap_void.go
wcfs/internal/xbtree/blib/zrangemap_void.go
+1
-0
wcfs/internal/xbtree/zrangemap_rebuildjob.go
wcfs/internal/xbtree/zrangemap_rebuildjob.go
+10
-7
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+2
-2
No files found.
wcfs/internal/xbtree/blib/rangemap.go.in
View file @
2370caa6
...
...
@@ -73,6 +73,7 @@ func (M *RangedMap) Has(k Key) bool {
//
Get_
is
comma
-
ok
version
of
Get
.
func
(
M
*
RangedMap
)
Get_
(
k
Key
)
(
v
VALUE
,
r
KeyRange
,
ok
bool
)
{
r
=
KeyRange
{
0
,-
1
}
//
zero
value
represents
non
-
empty
[
0
,
1
)
if
traceRangeMap
{
fmt
.
Printf
(
"
\n\n
Get_:
\n
"
)
fmt
.
Printf
(
" M: %s
\n
"
,
M
)
...
...
wcfs/internal/xbtree/blib/zrangemap_str.go
View file @
2370caa6
...
...
@@ -75,6 +75,7 @@ func (M *_RangedMap_str) Has(k Key) bool {
// Get_ is comma-ok version of Get.
func
(
M
*
_RangedMap_str
)
Get_
(
k
Key
)
(
v
string
,
r
KeyRange
,
ok
bool
)
{
r
=
KeyRange
{
0
,
-
1
}
// zero value represents non-empty [0,1)
if
trace_RangedMap_str
{
fmt
.
Printf
(
"
\n\n
Get_:
\n
"
)
fmt
.
Printf
(
" M: %s
\n
"
,
M
)
...
...
wcfs/internal/xbtree/blib/zrangemap_void.go
View file @
2370caa6
...
...
@@ -75,6 +75,7 @@ func (M *_RangedMap_void) Has(k Key) bool {
// Get_ is comma-ok version of Get.
func
(
M
*
_RangedMap_void
)
Get_
(
k
Key
)
(
v
void
,
r
KeyRange
,
ok
bool
)
{
r
=
KeyRange
{
0
,
-
1
}
// zero value represents non-empty [0,1)
if
trace_RangedMap_void
{
fmt
.
Printf
(
"
\n\n
Get_:
\n
"
)
fmt
.
Printf
(
" M: %s
\n
"
,
M
)
...
...
wcfs/internal/xbtree/zrangemap_rebuildjob.go
View file @
2370caa6
...
...
@@ -51,9 +51,11 @@ type _RangedMap_RebuildJobEntry struct {
// Get returns value associated with key k.
func
(
M
*
_RangedMap_RebuildJob
)
Get
(
k
Key
)
*
_RebuildJob
{
v
,
_
:=
M
.
Get_
(
k
)
return
v
//
// blib.KeyRange indicates all keys adjacent to k, that are too mapped to the same value.
func
(
M
*
_RangedMap_RebuildJob
)
Get
(
k
Key
)
(
*
_RebuildJob
,
blib
.
KeyRange
)
{
v
,
r
,
_
:=
M
.
Get_
(
k
)
return
v
,
r
}
// Set changes M to map key k to value v.
...
...
@@ -68,20 +70,21 @@ func (M *_RangedMap_RebuildJob) Del(k Key) {
// Has returns whether key k is present in the map.
func
(
M
*
_RangedMap_RebuildJob
)
Has
(
k
Key
)
bool
{
_
,
ok
:=
M
.
Get_
(
k
)
_
,
_
,
ok
:=
M
.
Get_
(
k
)
return
ok
}
// Get_ is comma-ok version of Get.
func
(
M
*
_RangedMap_RebuildJob
)
Get_
(
k
Key
)
(
v
*
_RebuildJob
,
ok
bool
)
{
func
(
M
*
_RangedMap_RebuildJob
)
Get_
(
k
Key
)
(
v
*
_RebuildJob
,
r
blib
.
KeyRange
,
ok
bool
)
{
r
=
blib
.
KeyRange
{
0
,
-
1
}
// zero value represents non-empty [0,1)
if
trace_RangedMap_RebuildJob
{
fmt
.
Printf
(
"
\n\n
Get_:
\n
"
)
fmt
.
Printf
(
" M: %s
\n
"
,
M
)
fmt
.
Printf
(
" k: %s
\n
"
,
blib
.
KStr
(
k
))
defer
func
()
{
fmt
.
Printf
(
"->·: %v
, %t
\n
"
,
v
,
ok
)
fmt
.
Printf
(
"->·: %v
%s, %t
\n
"
,
v
,
r
,
ok
)
}()
}
...
...
@@ -104,7 +107,7 @@ func (M *_RangedMap_RebuildJob) Get_(k Key) (v *_RebuildJob, ok bool) {
}
// found
return
e
.
Value
,
true
return
e
.
Value
,
e
.
KeyRange
,
true
}
// SetRange changes M to map key range r to value v.
...
...
wcfs/internal/xbtree/δbtail.go
View file @
2370caa6
...
...
@@ -489,7 +489,7 @@ func (δBtail *ΔBtail) vδTSnapForTrackedKey(root zodb.Oid, key Key) (vδT []Δ
if
!
δTtail
.
ktrackNew
.
Has
(
key
)
{
// key ∉ ktrackNew
job
,
inJobs
:=
δTtail
.
krebuildJobs
.
Get_
(
key
)
job
,
_
,
inJobs
:=
δTtail
.
krebuildJobs
.
Get_
(
key
)
if
!
inJobs
{
// key ∉ krebuildJobs -> it should be already in trackSet
vδT
=
δTtail
.
vδT
...
...
@@ -608,7 +608,7 @@ func (δTtail *_ΔTtail) __rebuild(root zodb.Oid, δBtail *ΔBtail, releaseLock
// krebuildJobs -= ktrackNew
for
_
,
r
:=
range
ktrackNew
.
AllRanges
()
{
// assert krebuildJobs[r] = job
job_
,
r_
:=
δTtail
.
krebuildJobs
.
Get
_
(
r
.
Lo
)
job_
,
r_
:=
δTtail
.
krebuildJobs
.
Get
(
r
.
Lo
)
if
!
(
job_
==
job
&&
r_
==
r
)
{
panicf
(
"BUG: rebuild: epilogue: "
+
"krebuildJobs entry mutated:
\n
set in prologue [%s]=%p
\n
got in epilogue: [%s]=%p"
,
...
...
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