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
55d3f53c
Commit
55d3f53c
authored
Apr 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
539ec405
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
wcfs/wcfs.go
wcfs/wcfs.go
+4
-4
wcfs/δbtail.go
wcfs/δbtail.go
+5
-4
wcfs/δftail.go
wcfs/δftail.go
+9
-7
No files found.
wcfs/wcfs.go
View file @
55d3f53c
...
...
@@ -863,9 +863,9 @@ retry:
return
err
}
if
false
{
// XXX -> V(2) ?
if
!
log
.
V
(
2
)
{
// debug dump δF
fmt
.
Print
f
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
log
.
Info
f
(
"
\n\n
S: handleδZ: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
for
file
,
δfile
:=
range
δF
.
ByFile
{
blkv
:=
δfile
.
Blocks
.
Elements
()
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
...
...
@@ -875,9 +875,9 @@ retry:
if
δfile
.
Size
{
size
=
"S"
}
fmt
.
Print
f
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
log
.
Info
f
(
"S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
}
fmt
.
Print
f
(
"
\n\n
"
)
log
.
Info
f
(
"
\n\n
"
)
}
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
...
...
wcfs/δbtail.go
View file @
55d3f53c
...
...
@@ -120,7 +120,7 @@ type ΔValue struct {
// It semantically consists of
//
// []δB ; rev ∈ (tail, head]
// atTail
// atTail
XXX no need (see vvv)
//
// where δB represents a change in BTrees space
//
...
...
@@ -154,10 +154,11 @@ type ΔValue struct {
// that ∈ BTree subgraphs that were explicitly requested to be tracked by δB.
//
// XXX incremental; not full coverage
// XXX see also zodb.ΔTail .
//
// ΔBtail is not safe for concurrent access.
// XXX -> multiple readers / single writer?
//
// See also zodb.ΔTail
type
ΔBtail
struct
{
// raw ZODB changes; Kept to rebuild δBtail/byRoot after new Track.
// includes all changed objects, not only tracked ones.
...
...
@@ -347,8 +348,8 @@ type ΔTree struct {
// Initial tracked set is empty.
// Initial coverage is (at₀, at₀].
//
// db will be used by ΔBtail to open database connections
... XXX
// XXX or caller provides zhead/zprev explicitly?
// db will be used by ΔBtail to open database connections
to load data from
//
ZODB when needed.
XXX or caller provides zhead/zprev explicitly?
func
NewΔBtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔBtail
{
return
&
ΔBtail
{
δZtail
:
zodb
.
NewΔTail
(
at0
),
...
...
wcfs/δftail.go
View file @
55d3f53c
...
...
@@ -24,6 +24,7 @@ package main
import
(
"context"
"fmt"
"runtime"
"sync"
...
...
@@ -95,7 +96,6 @@ type ΔFile struct {
Size
bool
// whether file size changed
}
// zblkInΔFtail is ΔFtail-related volatile data embedded into ZBlk*.
//
// The data is preserved even when ZBlk comes to ghost state, but is lost if
...
...
@@ -120,7 +120,8 @@ func (z *zblkInΔFtail) inΔFtail() *zblkInΔFtail { return z }
// Initial tracked set is empty.
// Initial coverage of created ΔFtail is (at₀, at₀].
//
// XXX db
// db will be used by ΔFtail to open database connections to load data from
// ZODB when needed.
func
NewΔFtail
(
at0
zodb
.
Tid
,
db
*
zodb
.
DB
)
*
ΔFtail
{
return
&
ΔFtail
{
δBtail
:
NewΔBtail
(
at0
,
db
),
...
...
@@ -134,7 +135,7 @@ func (δFtail *ΔFtail) Head() zodb.Tid { return δFtail.δBtail.Head() }
func
(
δFtail
*
ΔFtail
)
Tail
()
zodb
.
Tid
{
return
δFtail
.
δBtail
.
Tail
()
}
// Track associates file[blk]
with tree path and zblk object there
.
// Track associates file[blk]
@head with tree path and zblk object
.
//
// zblk can be nil, which represents a hole.
// XXX blk=-1 is used for tracking after Size (no zblk is accessed at all).
...
...
@@ -143,6 +144,8 @@ func (δFtail *ΔFtail) Tail() zodb.Tid { return δFtail.δBtail.Tail() }
//
// XXX text
//
// XXX objects in path and zblk must be with .PJar().At() == .head
//
// A root can be associated with several files (each provided on different Track call).
func
(
δFtail
*
ΔFtail
)
Track
(
file
*
BigFile
,
blk
int64
,
path
[]
btree
.
LONode
,
zblk
ZBlk
)
{
if
blk
==
-
1
{
...
...
@@ -225,7 +228,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
for
root
,
δt
:=
range
δB
.
ByRoot
{
files
:=
δFtail
.
fileIdx
[
root
]
if
len
(
files
)
==
0
{
panicf
(
"
ΔFtail: root<%s> -> ø file
"
,
root
)
panicf
(
"
BUG: ΔFtail: root<%s> -> ø files
"
,
root
)
}
for
file
:=
range
files
{
δfile
,
ok
:=
δF
.
ByFile
[
file
]
...
...
@@ -277,11 +280,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *ZConn) (_ ΔF, err
// XXX update z.infile according to btree changes
case
*
ZBigFile
:
//
XXX
check that .blksize and .blktab (it is only
//
TODO
check that .blksize and .blktab (it is only
// persistent reference) do not change.
// XXX shutdown fs with ^^^ message.
panic
(
"ZBigFile changed"
)
return
ΔF
{},
fmt
.
Errorf
(
"ZBigFile<%s> changed @%s"
,
oid
,
δZ
.
Tid
)
}
// make sure obj won't be garbage-collected until we finish handling it.
...
...
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