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
f9c29c14
Commit
f9c29c14
authored
Jul 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
de844b01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+29
-2
No files found.
wcfs/internal/zdata/δftail.go
View file @
f9c29c14
...
@@ -25,6 +25,7 @@ package zdata
...
@@ -25,6 +25,7 @@ package zdata
import
(
import
(
"context"
"context"
"fmt"
"fmt"
"sort"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/neo/go/transaction"
"lab.nexedi.com/kirr/neo/go/transaction"
...
@@ -539,7 +540,34 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -539,7 +540,34 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
func
(
δFtail
*
ΔFtail
)
LastBlkRev
(
ctx
context
.
Context
,
zf
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
func
(
δFtail
*
ΔFtail
)
LastBlkRev
(
ctx
context
.
Context
,
zf
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
)
{
//defer xerr.Contextf(&err, "") // XXX text
//defer xerr.Contextf(&err, "") // XXX text
//δftail := δFtail.byFile[zf.POid()]
// XXX locking
// XXX rebuild
δftail
:=
δFtail
.
byFile
[
zf
.
POid
()]
// find epoch that covers at
vδE
:=
δftail
.
vδE
l
:=
len
(
vδE
)
i
:=
sort
.
Search
(
l
,
func
(
i
int
)
bool
{
return
at
<
vδE
[
i
]
.
Rev
})
// vδE[i] is next epoch
// vδE[i-1] is epoch that covers at
var
root
zodb
.
Oid
var
epoch
zodb
.
Tid
if
i
==
l
{
root
=
zf
.
blktab
// XXX activate
}
else
{
root
=
vδE
[
i
]
.
oldRoot
}
i
--
if
i
<
0
{
// i<0 - first epoch (no explicit start) - use δFtail.tail as lo
epoch
=
δFtail
.
Tail
()
}
else
{
epoch
=
vδE
[
i
]
.
Rev
}
//root := δftail.root // XXX handle epochs
//root := δftail.root // XXX handle epochs
err
:=
zf
.
PActivate
(
ctx
)
err
:=
zf
.
PActivate
(
ctx
)
...
@@ -553,7 +581,6 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64,
...
@@ -553,7 +581,6 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64,
defer
zf
.
PDeactivate
()
defer
zf
.
PDeactivate
()
// XXX take epochs into account
// XXX take epochs into account
epoch
:=
zodb
.
Tid
(
0
)
// XXX stub
// XXX tabRev -> treeRev ?
// XXX tabRev -> treeRev ?
//zblkOid, ok, tabRev, tabRevExact, err := δFtail.δBtail.GetAt(ctx, root, blk, at)
//zblkOid, ok, tabRev, tabRevExact, err := δFtail.δBtail.GetAt(ctx, root, blk, at)
...
...
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