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
dc40c397
Commit
dc40c397
authored
Sep 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f89b0ce2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+1
-5
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+12
-10
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
dc40c397
...
...
@@ -340,8 +340,6 @@ func (δBtail *ΔBtail) rebuild1(root zodb.Oid) error {
// - set of nodes that must be added to ΔBtail.trackSet to account for
// keys that becomes tracked. Note: this set is potentially wider compared to what was in .trackNew.
// - set of revisions for which new entries in .vδT have been created.
//
// XXX place
func
(
δTtail
*
_ΔTtail
)
rebuild
(
root
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
δtrackSet
blib
.
PPTreeSubSet
,
δrevSet
setTid
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"ΔTtail<%s> rebuild"
,
root
)
// XXX locking
...
...
@@ -719,7 +717,7 @@ func (δBtail *ΔBtail) vδBroots_Update1(root zodb.Oid, rev zodb.Tid) {
func
(
δBtail
*
ΔBtail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
// XXX locking
δBtail
.
δZtail
.
ForgetPast
(
revCut
)
// XXX stub
δBtail
.
δZtail
.
ForgetPast
(
revCut
)
// go through vδBroots till revcut -> find which trees to trim -> trim ΔTtails.
...
...
@@ -846,8 +844,6 @@ func (δBtail *ΔBtail) GetAt(root zodb.Oid, key Key, at zodb.Tid) (value Value,
// Only tracked keys are guaranteed to be present.
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
//
// XXX root -> *Tree ?
func
(
δBtail
*
ΔBtail
)
SliceByRootRev
(
root
zodb
.
Oid
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
ΔTree
{
xtail
.
AssertSlice
(
δBtail
,
lo
,
hi
)
// XXX locking
...
...
wcfs/internal/zdata/δftail.go
View file @
dc40c397
...
...
@@ -581,7 +581,8 @@ func (δftail *_ΔFileTail) forgetPast(revCut zodb.Tid) {
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
zfile
*
ZBigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
*
ΔFile
{
//fmt.Printf("\nslice f<%s> (@%s,@%s]\n", zfile.POid(), lo, hi)
foid
:=
zfile
.
POid
()
//fmt.Printf("\nslice f<%s> (@%s,@%s]\n", foid, lo, hi)
xtail
.
AssertSlice
(
δFtail
,
lo
,
hi
)
// XXX locking
...
...
@@ -603,7 +604,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δFile ────────o───────o──────x─────x────────────────────────
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
zfile
.
POid
()
)
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
foid
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
...
...
@@ -815,18 +816,19 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
//
// if exact=False - what is returned is only an upper bound for last block revision.
//
// zf must be any checkout from (tail, head]
// zf
ile
must be any checkout from (tail, head]
// at must ∈ (tail, head]
// blk must be tracked
func
(
δFtail
*
ΔFtail
)
BlkRevAt
(
ctx
context
.
Context
,
zf
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
rev
,
exact
,
err
:=
δFtail
.
_BlkRevAt
(
ctx
,
zf
,
blk
,
at
)
func
(
δFtail
*
ΔFtail
)
BlkRevAt
(
ctx
context
.
Context
,
zf
ile
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
rev
,
exact
,
err
:=
δFtail
.
_BlkRevAt
(
ctx
,
zf
ile
,
blk
,
at
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
return
rev
,
exact
}
func
(
δFtail
*
ΔFtail
)
_BlkRevAt
(
ctx
context
.
Context
,
zf
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"blkrev f<%s> #%d @%s"
,
zf
.
POid
(),
blk
,
at
)
func
(
δFtail
*
ΔFtail
)
_BlkRevAt
(
ctx
context
.
Context
,
zfile
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
,
err
error
)
{
foid
:=
zfile
.
POid
()
defer
xerr
.
Contextf
(
&
err
,
"blkrev f<%s> #%d @%s"
,
foid
,
blk
,
at
)
//fmt.Printf("\nblkrev #%d @%s\n", blk, at)
...
...
@@ -837,8 +839,8 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64,
panicf
(
"at out of bounds: at: @%s, (tail, head] = (@%s, @%s]"
,
at
,
tail
,
head
)
}
// assert zf.at ∈ (tail, head]
zconn
:=
zf
.
PJar
()
// assert zf
ile
.at ∈ (tail, head]
zconn
:=
zf
ile
.
PJar
()
zconnAt
:=
zconn
.
At
()
if
!
(
tail
<
zconnAt
&&
zconnAt
<=
head
)
{
panicf
(
"zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]"
,
zconnAt
,
tail
,
head
)
...
...
@@ -846,7 +848,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zf *ZBigFile, blk int64,
// XXX locking
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
zf
.
POid
()
)
δftail
,
err
:=
δFtail
.
rebuildIfNeeded
(
foid
)
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
false
,
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