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
8adc4356
Commit
8adc4356
authored
Sep 01, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
eac5d619
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
23 deletions
+13
-23
wcfs/δbtail.go
wcfs/δbtail.go
+4
-1
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+6
-18
wcfs/δftail.go
wcfs/δftail.go
+3
-4
No files found.
wcfs/δbtail.go
View file @
8adc4356
...
...
@@ -294,6 +294,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// XXX path -> []oid ?
//
// XXX catch cycles on add?
/*
type TrackFlags int
const (
// TrackMaxKey
...
...
@@ -303,7 +304,9 @@ const (
// XXX TrackMinKey (we don't need it in WCFS)
)
func
(
δBtail
*
ΔBtail
)
Track
(
key
Key
,
keyPresent
bool
,
path
[]
Node
,
flags
TrackFlags
)
error
{
// XXX Tree|Bucket; path[0] = root
*/
//func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node, flags TrackFlags) error { // XXX Tree|Bucket; path[0] = root
func
(
δBtail
*
ΔBtail
)
Track
(
key
Key
,
keyPresent
bool
,
path
[]
Node
)
error
{
// XXX Tree|Bucket; path[0] = root
l
:=
len
(
path
)
if
l
==
0
{
panic
(
"empty path"
)
...
...
wcfs/δbtail_test.go
View file @
8adc4356
...
...
@@ -458,24 +458,15 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
adj1
:=
SetKey
{}
adj2
:=
SetKey
{}
k1
:=
k
k2
:=
k
/*
if k == kInf { // XXX not needed? - kill?
k1 = maxk1
k2 = maxk2
}
*/
q1
:=
[]
Key
{
k1
}
q2
:=
[]
Key
{
k2
}
q1
:=
[]
Key
{
k
}
q2
:=
[]
Key
{
k
}
//tracef("\n")
for
len
(
q1
)
>
0
||
len
(
q2
)
>
0
{
//tracef("q1: %v\n", q1)
//tracef("q2: %v\n", q2)
if
l1
:=
len
(
q1
);
l1
>
0
{
k1
=
q1
[
l1
-
1
];
q1
=
q1
[
:
l1
-
1
]
k1
:
=
q1
[
l1
-
1
];
q1
=
q1
[
:
l1
-
1
]
if
!
adj1
.
Has
(
k1
)
{
for
k_
:=
range
xkv1
.
Get
(
k1
)
.
kv
{
adj1
.
Add
(
k_
)
...
...
@@ -489,7 +480,7 @@ func xverifyΔBTail(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid, a
}
if
l2
:=
len
(
q2
);
l2
>
0
{
k2
=
q2
[
l2
-
1
];
q2
=
q2
[
:
l2
-
1
]
k2
:
=
q2
[
l2
-
1
];
q2
=
q2
[
:
l2
-
1
]
if
!
adj2
.
Has
(
k2
)
{
for
k_
:=
range
xkv2
.
Get
(
k2
)
.
kv
{
adj2
.
Add
(
k_
)
...
...
@@ -571,11 +562,8 @@ func xverifyΔBTail1(t *testing.T, subj string, db *zodb.DB, treeRoot zodb.Oid,
});
X
(
err
)
// kInf imitates ZBigFile.Size() request, which enables maxkey tracking.
trackFlags
:=
TrackFlags
(
0
)
if
k
==
kInf
{
trackFlags
=
TrackMaxKey
}
err
=
δbtail
.
Track
(
k
,
ok
,
path
,
trackFlags
);
X
(
err
)
// XXX ^^^ comment place = ?
err
=
δbtail
.
Track
(
k
,
ok
,
path
);
X
(
err
)
kadjTracked
.
Update
(
kadj
[
k
])
}
...
...
wcfs/δftail.go
View file @
8adc4356
...
...
@@ -137,12 +137,11 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
//
// A root can be associated with several files (each provided on different Track call).
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
blk
int64
,
path
[]
btree
.
LONode
,
zblk
zBlk
)
{
δbTrackFlags
:=
TrackFlags
(
0
)
if
blk
==
-
1
{
// XXX blk = ∞ ?
δbTrackFlags
=
TrackMaxKey
// XXX blk = ∞
from beginning
?
blk
=
KeyMax
}
err
:=
δFtail
.
δBtail
.
Track
(
blk
,
zblk
!=
nil
,
path
,
δbTrackFlags
)
err
:=
δFtail
.
δBtail
.
Track
(
blk
,
zblk
!=
nil
,
path
)
if
err
!=
nil
{
panic
(
err
)
// XXX -> error? errctx
}
...
...
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