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
8dcdc4e5
Commit
8dcdc4e5
authored
Apr 18, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c63dbe30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
wcfs/δbtail.go
wcfs/δbtail.go
+16
-6
wcfs/δftail.go
wcfs/δftail.go
+14
-5
No files found.
wcfs/δbtail.go
View file @
8dcdc4e5
...
...
@@ -66,9 +66,11 @@ type Value = zodb.Oid // XXX assumes key points to IPersistent
//
// .Track(path) - start tracking tree nodes and keys; root=path[0], keys=path[-1].keys
//
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .Get(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
// .Update(δZ) -> δB - update BTree δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δB - XXX
// .SliceByRootRev(root, lo, hi) -> []δT - XXX
// .Get(root, key, at) - get root[key] @at assuming root[key] ∈ tracked
//
// An example for tracked set is a set of visited BTree paths.
// There is no requirement that tracked set belongs to only one single BTree.
...
...
@@ -95,7 +97,7 @@ type ΔBtail struct {
// tracked index: BTree|Bucket -> top tree element.
trackIdx
map
[
zodb
.
Oid
]
SetTree
// oid -> {} roots XXX root -> oid?
// tracked objects that are not yet taken into in current δBtail
// tracked objects that are not yet taken into
account
in current δBtail
trackNew
map
[
zodb
.
Oid
]
struct
{}
// XXX SetOid
}
...
...
@@ -342,7 +344,15 @@ func (δBtail *ΔBtail) SliceByRev(lo, hi zodb.Tid) /*readonly*/ []ΔB {
panic
(
"TODO"
)
}
// XXX
// SliceByRootRev returns history of a tree changes in (lo, hi] range.
//
// it must be called with the following condition:
//
// tail ≤ lo ≤ hi ≤ head
//
// the caller must not modify returned slice.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func
(
δBtail
*
ΔBtail
)
SliceByRootRev
(
root
*
Tree
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔTree
{
δassertSlice
(
δBtail
,
lo
,
hi
)
...
...
@@ -397,7 +407,7 @@ func (δBtail *ΔBtail) SliceByRootRev(root *Tree, lo, hi zodb.Tid) /*readonly*/
// . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
//
misc
//
---- misc ----
// δassertSlice asserts that δ.tail ≤ lo ≤ hi ≤ δ.head
func
δassertSlice
(
δ
interface
{
Head
()
zodb
.
Tid
;
Tail
()
zodb
.
Tid
},
lo
,
hi
zodb
.
Tid
)
{
...
...
wcfs/δftail.go
View file @
8dcdc4e5
...
...
@@ -44,8 +44,8 @@ import (
//
// ΔFtail provides the following operations:
//
// .Track(file, blkTreePath)
- add file and block reached via BTree path to
//
tracked set.
// .Track(file, blkTreePath)
- add file and block reached via BTree path to tracked set.
//
// .Update(δZ) -> δF - update files δ tail given raw ZODB changes
// .ForgetPast(revCut) - forget changes past revCut
// .SliceByRev(lo, hi) -> []δF - query for all files changes with rev ∈ (lo, hi]
...
...
@@ -162,12 +162,21 @@ func (δFtail *ΔFtail) SliceByRev(lo, hi zodb.Tid) /*readonly*/ []ΔF {
panic
(
"TODO"
)
}
// XXX
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
f
*
BigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
Δfile
{
// SliceByFileRev returns history of file changes in (lo, hi] range.
//
// it must be called with the following condition:
//
// tail ≤ lo ≤ hi ≤ head
//
// the caller must not modify returned slice.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
file
*
BigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
Δfile
{
δassertSlice
(
δFtail
,
lo
,
hi
)
// XXX activate zfile?
vδT
:=
δFtail
.
δBtail
.
SliceByRootRev
(
f
.
zfile
.
blktab
,
lo
,
hi
)
vδT
:=
δFtail
.
δBtail
.
SliceByRootRev
(
file
.
zfile
.
blktab
,
lo
,
hi
)
//kv = kvAtTail
_
=
vδT
panic
(
"TODO"
)
...
...
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