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
312d0f25
Commit
312d0f25
authored
Oct 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
588a512a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
28 deletions
+4
-28
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+4
-28
No files found.
wcfs/internal/zdata/δftail.go
View file @
312d0f25
...
...
@@ -627,7 +627,7 @@ func (δftail *_ΔFileTail) _forgetPast(revCut zodb.Tid) {
// - DelBlk(zblk, blk)
type
_ZinblkOverlay
struct
{
Base
map
[
zodb
.
Oid
]
setI64
// taken from _RootTrack.Zinblk or _ΔFileEpoch.oldZinblk
Adj
map
[
zodb
.
Oid
]
setI64
// blk<0 reresents whitout
Adj
map
[
zodb
.
Oid
]
setI64
//
adjustement over base;
blk<0 reresents whitout
}
// SliceByFileRev returns history of file changes in (lo, hi] range.
...
...
@@ -718,7 +718,6 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
var
head
zodb
.
Tid
// head] of current epoch coverage
// state of Zinblk as we are scanning ← current epoch
// initially corresponds to head of the epoch (= @head for latest epoch)
// Zinblk := map[zodb.Oid]setI64{} // zblk -> which #blk refers to it
Zinblk
:=
_ZinblkOverlay
{}
// zblk -> which #blk refers to it
var
ZinblkAt
zodb
.
Tid
// Zinblk covers [ZinblkAt,<next δT>)
if
ie
+
1
==
le
{
...
...
@@ -728,18 +727,12 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
rt
,
ok
:=
δFtail
.
byRoot
[
root
]
// XXX locking
if
ok
{
Zinblk
.
Base
=
rt
.
Zinblk
// for zblk, inblk := range rt.Zinblk { // XXX -> no clone
// Zinblk[zblk] = inblk.Clone()
// }
}
}
else
{
δE
:=
vδE
[
ie
+
1
]
root
=
δE
.
oldRoot
head
=
δE
.
Rev
-
1
// TODO better set to exact revision coming before δE.Rev
Zinblk
.
Base
=
δE
.
oldZinblk
// for zblk, inblk := range δE.oldZinblk {
// Zinblk[zblk] = inblk.Clone() // XXX -> no Clone needed
// }
}
//fmt.Printf("Zinblk: %v\n", Zinblk)
...
...
@@ -791,16 +784,6 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
}
}
}
/*
for zblk, inblkAdj := range ZinblkAdj {
inblk, ok := Zinblk[zblk]
if !ok {
Zinblk[zblk] = inblkAdj
} else {
inblk.Update(inblkAdj)
}
}
*/
// merge vδZ and vδT of current epoch
for
((
iz
>=
0
&&
vδZ
[
iz
]
.
Rev
>
epoch
)
||
it
>=
0
)
{
...
...
@@ -830,19 +813,9 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// apply in reverse as we go ←
if
δzblk
.
New
!=
xbtree
.
VDEL
{
Zinblk
.
DelBlk
(
δzblk
.
New
,
blk
)
// inblk, ok := Zinblk[δzblk.New] // XXX
// if ok {
// inblk.Del(blk)
// }
}
if
δzblk
.
Old
!=
xbtree
.
VDEL
{
Zinblk
.
AddBlk
(
δzblk
.
Old
,
blk
)
// inblk, ok := Zinblk[δzblk.Old] // XXX
// if !ok {
// inblk = setI64{}
// Zinblk[δzblk.Old] = inblk
// }
// inblk.Add(blk)
}
if
δT
.
Rev
<=
hi
{
...
...
@@ -884,6 +857,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// ZinblkOverlay XXX move closer to end?
// Get_ returns set(blk) for o[zoid].
func
(
o
*
_ZinblkOverlay
)
Get_
(
zoid
zodb
.
Oid
)
(
inblk
/*readonly*/
setI64
,
ok
bool
)
{
base
,
bok
:=
o
.
Base
[
zoid
]
adj
,
aok
:=
o
.
Adj
[
zoid
]
...
...
@@ -910,6 +884,7 @@ func (o *_ZinblkOverlay) Get_(zoid zodb.Oid) (inblk /*readonly*/setI64, ok bool)
return
inblk
,
true
}
// DelBlk removes blk from o[zoid].
func
(
o
*
_ZinblkOverlay
)
DelBlk
(
zoid
zodb
.
Oid
,
blk
int64
)
{
if
blk
<
0
{
panic
(
"blk < 0"
)
...
...
@@ -917,6 +892,7 @@ func (o *_ZinblkOverlay) DelBlk(zoid zodb.Oid, blk int64) {
o
.
_AddBlk
(
zoid
,
flipsign
(
blk
))
}
// AddBlk adds blk to o[zoid].
func
(
o
*
_ZinblkOverlay
)
AddBlk
(
zoid
zodb
.
Oid
,
blk
int64
)
{
if
blk
<
0
{
panic
(
"blk < 0"
)
...
...
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