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
be0fed1e
Commit
be0fed1e
authored
Apr 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cb778a7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
wcfs/zblk.go
wcfs/zblk.go
+14
-11
wcfs/δbtail.go
wcfs/δbtail.go
+1
-1
wcfs/δftail.go
wcfs/δftail.go
+1
-0
No files found.
wcfs/zblk.go
View file @
be0fed1e
...
...
@@ -92,6 +92,9 @@ type zBlk interface {
blkBoundTo
()
map
[
*
BigFile
]
SetI64
}
var
_
zBlk
=
(
*
ZBlk0
)(
nil
)
var
_
zBlk
=
(
*
ZBlk1
)(
nil
)
// ---- zBlkBase ----
// zBlkBase provides common functionality to implement ZBlk* -> zfile, #blk binding.
...
...
@@ -99,29 +102,29 @@ type zBlk interface {
// The data stored by zBlkBase is transient - it is _not_ included into
// persistent state.
type
zBlkBase
struct
{
bindMu
sync
.
Mutex
// used only for binding to support multiple loaders
in
zfile
map
[
*
Z
BigFile
]
SetI64
// {} zfile -> set(#blk)
bindMu
sync
.
Mutex
// used only for binding to support multiple loaders
in
file
map
[
*
BigFile
]
SetI64
// {} zfile -> set(#blk)
}
// bind
Z
File implements zBlk.
func
(
zb
*
zBlkBase
)
bind
ZFile
(
zfile
*
Z
BigFile
,
blk
int64
)
{
// bindFile implements zBlk.
func
(
zb
*
zBlkBase
)
bind
File
(
file
*
BigFile
,
blk
int64
)
{
zb
.
bindMu
.
Lock
()
defer
zb
.
bindMu
.
Unlock
()
blkmap
,
ok
:=
zb
.
in
zfile
[
z
file
]
blkmap
,
ok
:=
zb
.
in
file
[
file
]
if
!
ok
{
blkmap
=
make
(
SetI64
,
1
)
if
zb
.
in
z
file
==
nil
{
zb
.
in
zfile
=
make
(
map
[
*
Z
BigFile
]
SetI64
)
if
zb
.
infile
==
nil
{
zb
.
in
file
=
make
(
map
[
*
BigFile
]
SetI64
)
}
zb
.
in
zfile
[
z
file
]
=
blkmap
zb
.
in
file
[
file
]
=
blkmap
}
blkmap
.
Add
(
blk
)
}
// blkBoundTo implementss zBlk.
func
(
zb
*
zBlkBase
)
blkBoundTo
()
map
[
*
Z
BigFile
]
SetI64
{
return
zb
.
in
z
file
func
(
zb
*
zBlkBase
)
blkBoundTo
()
map
[
*
BigFile
]
SetI64
{
return
zb
.
infile
}
// ---- ZBlk0 ----
...
...
@@ -172,7 +175,6 @@ func (zb *ZBlk0) loadBlkData(ctx context.Context) ([]byte, zodb.Tid, error) {
// ZData mimics ZData from python.
type
ZData
struct
{
zBlkBase
// XXX -> ZBlk1, not here?
zodb
.
Persistent
// XXX py source uses bytes(buf) but on python2 it still results in str
...
...
@@ -202,6 +204,7 @@ func (zd *zDataState) PySetState(pystate interface{}) error {
// ZBlk1 mimics ZBlk1 from python.
type
ZBlk1
struct
{
zBlkBase
zodb
.
Persistent
chunktab
*
btree
.
IOBTree
// {} offset -> ZData(chunk)
...
...
wcfs/δbtail.go
View file @
be0fed1e
...
...
@@ -91,7 +91,7 @@ type ΔBtail struct {
δRtail
[]
ΔRoots
// which BTree were changed; Noted only by keys ∈ tracket subset
byRoot
map
[
*
Tree
]
*
ΔTreeTail
// root -> k/v change history; only for keys ∈ tracket subset
// XXX or ask client provide db on every call?
// XXX or ask client
to
provide db on every call?
db
*
zodb
.
DB
// to open connections to load new/old tree|buckets
// tracked index: BTree|Bucket -> top tree element.
...
...
wcfs/δftail.go
View file @
be0fed1e
...
...
@@ -153,6 +153,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
// take zblk changes into account
for
_
,
oid
:=
range
δZ
.
Changev
{
// XXX cache lock/unlock
var
zcache
*
zodb
.
LiveCache
// XXX stub
obj
:=
zcache
.
Get
(
oid
)
if
obj
==
nil
{
//fmt.Printf("%s: not in cache\n", oid)
...
...
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