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
73811795
Commit
73811795
authored
Oct 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e8804bd5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+3
-10
No files found.
wcfs/internal/zdata/δftail.go
View file @
73811795
...
@@ -664,7 +664,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -664,7 +664,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// head
// head
root
=
headRoot
root
=
headRoot
head
=
δFtail
.
Head
()
head
=
δFtail
.
Head
()
for
zblk
,
zt
:=
range
δFtail
.
trackSetZBlk
{
for
zblk
,
zt
:=
range
δFtail
.
trackSetZBlk
{
// XXX locking
inblk
,
ok
:=
zt
.
inroot
[
root
]
inblk
,
ok
:=
zt
.
inroot
[
root
]
if
ok
{
if
ok
{
Zinblk
[
zblk
]
=
inblk
.
Clone
()
Zinblk
[
zblk
]
=
inblk
.
Clone
()
...
@@ -847,16 +847,12 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
...
@@ -847,16 +847,12 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
panicf
(
"zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]"
,
zconnAt
,
tail
,
head
)
panicf
(
"zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]"
,
zconnAt
,
tail
,
head
)
}
}
// XXX locking
// δftail, err := δFtail.rebuild1IfNeeded(foid)
vδE
,
headRoot
,
err
:=
δFtail
.
rebuild1IfNeeded
(
foid
)
vδE
,
headRoot
,
err
:=
δFtail
.
rebuild1IfNeeded
(
foid
)
if
err
!=
nil
{
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
false
,
err
return
zodb
.
InvalidTid
,
false
,
err
}
}
// find epoch that covers at and associated blktab root/object
// find epoch that covers at and associated blktab root/object
// vδE := δftail.vδE
//fmt.Printf(" vδE: %v\n", vδE)
//fmt.Printf(" vδE: %v\n", vδE)
l
:=
len
(
vδE
)
l
:=
len
(
vδE
)
i
:=
sort
.
Search
(
l
,
func
(
i
int
)
bool
{
i
:=
sort
.
Search
(
l
,
func
(
i
int
)
bool
{
...
@@ -868,7 +864,6 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
...
@@ -868,7 +864,6 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
// root
// root
var
root
zodb
.
Oid
var
root
zodb
.
Oid
if
i
==
l
{
if
i
==
l
{
// root = δftail.root
root
=
headRoot
root
=
headRoot
}
else
{
}
else
{
root
=
vδE
[
i
]
.
oldRoot
root
=
vδE
[
i
]
.
oldRoot
...
@@ -879,7 +874,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
...
@@ -879,7 +874,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
i
--
i
--
if
i
<
0
{
if
i
<
0
{
// i<0 - first epoch (no explicit start) - use δFtail.tail as lo
// i<0 - first epoch (no explicit start) - use δFtail.tail as lo
epoch
=
δFtail
.
Tail
()
epoch
=
tail
}
else
{
}
else
{
epoch
=
vδE
[
i
]
.
Rev
epoch
=
vδE
[
i
]
.
Rev
}
}
...
@@ -948,9 +943,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
...
@@ -948,9 +943,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
// ---- vδEBuild (rebuild core) ----
// ---- vδEBuild (rebuild core) ----
// vδEBuild builds vδE from vδZ for file.
// vδEBuild builds vδE for file from vδZ.
//
// XXX place ok?
func
vδEBuild
(
foid
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
vδE
[]
_ΔFileEpoch
,
err
error
)
{
func
vδEBuild
(
foid
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
vδE
[]
_ΔFileEpoch
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"file<%s>: build vδE"
,
foid
)
defer
xerr
.
Contextf
(
&
err
,
"file<%s>: build vδE"
,
foid
)
...
...
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