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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
5d106a33
Commit
5d106a33
authored
Apr 14, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
06b6d9c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+33
-3
wcfs/wcfs.go
wcfs/wcfs.go
+0
-1
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
5d106a33
...
...
@@ -36,6 +36,7 @@ type Bucket = btree.LOBucket
type
Node
=
btree
.
LONode
type
Key
=
int64
type
Value
=
zodb
.
Oid
// XXX assumes key points to IPersistent
// XXX how to represent deletion? InvalidOid?
// ΔTail represents tail of revisional changes to BTrees.
//
...
...
@@ -98,10 +99,10 @@ type ΔRoots struct {
//
// See ΔTail documentation for details.
type
ΔTreeTail
struct
{
δTtail
[]
ΔTree
// changes to tree keys; covers keys ∈ tracket subset
δTtail
[]
ΔTree
// changes to tree keys;
rev↑.
covers keys ∈ tracket subset
// {}k/v @tail for keys that are changed in (tail, head].
atTail
map
[
*
Tree
]
map
[
Key
]
Value
KVAtTail
map
[
Key
]
Value
}
// ΔTree describes changes to one BTree in one revision.
...
...
@@ -238,8 +239,37 @@ func (btail *ΔTail) Update(δZ *zodb.EventCommit) []ΔTree {
//
// XXX at must ∈ (tail, head] XXX [tail ?
// XXX key must be tracked?
//
// XXX -> meth of ΔTreeTail ?
func
(
btail
*
ΔTail
)
GetAt
(
root
*
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
value
Value
,
ok
bool
,
rev
zodb
.
Tid
,
revExact
bool
)
{
panic
(
"TODO"
)
// XXX key not tracked -> panic
// XXX at not ∈ (tail, head] -> panic
// XXX -> index lastXXXOf(key)
δt
:=
btail
.
byRoot
[
root
]
for
i
:=
len
(
δt
.
δTtail
)
-
1
;
i
>=
0
;
i
--
{
δ
:=
δt
.
δTtail
[
i
]
if
at
<
δ
.
Rev
{
continue
}
value
,
ok
=
δ
.
KV
[
key
]
if
ok
{
rev
=
δ
.
Rev
revExact
=
true
break
}
}
// found key in history tail
if
ok
{
return
}
// key not in history tail
value
,
ok
=
δt
.
KVAtTail
[
key
]
rev
=
btail
.
Tail
()
revExact
=
false
return
}
func
(
btail
*
ΔTail
)
LastRevOf
(
root
*
Tree
,
key
Key
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
...
...
wcfs/wcfs.go
View file @
5d106a33
...
...
@@ -1095,7 +1095,6 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
}
// noone was loading - we became responsible to load this block
// blkdata, treepath, pathRevMax, err := f.zfile.LoadBlk(ctx, blk)
blkdata
,
treepath
,
zblkrev
,
err
:=
f
.
zfile
.
LoadBlk
(
ctx
,
blk
)
loading
.
blkdata
=
blkdata
loading
.
err
=
err
...
...
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