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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
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 {
...
@@ -92,6 +92,9 @@ type zBlk interface {
blkBoundTo
()
map
[
*
BigFile
]
SetI64
blkBoundTo
()
map
[
*
BigFile
]
SetI64
}
}
var
_
zBlk
=
(
*
ZBlk0
)(
nil
)
var
_
zBlk
=
(
*
ZBlk1
)(
nil
)
// ---- zBlkBase ----
// ---- zBlkBase ----
// zBlkBase provides common functionality to implement ZBlk* -> zfile, #blk binding.
// zBlkBase provides common functionality to implement ZBlk* -> zfile, #blk binding.
...
@@ -99,29 +102,29 @@ type zBlk interface {
...
@@ -99,29 +102,29 @@ type zBlk interface {
// The data stored by zBlkBase is transient - it is _not_ included into
// The data stored by zBlkBase is transient - it is _not_ included into
// persistent state.
// persistent state.
type
zBlkBase
struct
{
type
zBlkBase
struct
{
bindMu
sync
.
Mutex
// used only for binding to support multiple loaders
bindMu
sync
.
Mutex
// used only for binding to support multiple loaders
in
zfile
map
[
*
Z
BigFile
]
SetI64
// {} zfile -> set(#blk)
in
file
map
[
*
BigFile
]
SetI64
// {} zfile -> set(#blk)
}
}
// bind
Z
File implements zBlk.
// bindFile implements zBlk.
func
(
zb
*
zBlkBase
)
bind
ZFile
(
zfile
*
Z
BigFile
,
blk
int64
)
{
func
(
zb
*
zBlkBase
)
bind
File
(
file
*
BigFile
,
blk
int64
)
{
zb
.
bindMu
.
Lock
()
zb
.
bindMu
.
Lock
()
defer
zb
.
bindMu
.
Unlock
()
defer
zb
.
bindMu
.
Unlock
()
blkmap
,
ok
:=
zb
.
in
zfile
[
z
file
]
blkmap
,
ok
:=
zb
.
in
file
[
file
]
if
!
ok
{
if
!
ok
{
blkmap
=
make
(
SetI64
,
1
)
blkmap
=
make
(
SetI64
,
1
)
if
zb
.
in
z
file
==
nil
{
if
zb
.
infile
==
nil
{
zb
.
in
zfile
=
make
(
map
[
*
Z
BigFile
]
SetI64
)
zb
.
in
file
=
make
(
map
[
*
BigFile
]
SetI64
)
}
}
zb
.
in
zfile
[
z
file
]
=
blkmap
zb
.
in
file
[
file
]
=
blkmap
}
}
blkmap
.
Add
(
blk
)
blkmap
.
Add
(
blk
)
}
}
// blkBoundTo implementss zBlk.
// blkBoundTo implementss zBlk.
func
(
zb
*
zBlkBase
)
blkBoundTo
()
map
[
*
Z
BigFile
]
SetI64
{
func
(
zb
*
zBlkBase
)
blkBoundTo
()
map
[
*
BigFile
]
SetI64
{
return
zb
.
in
z
file
return
zb
.
infile
}
}
// ---- ZBlk0 ----
// ---- ZBlk0 ----
...
@@ -172,7 +175,6 @@ func (zb *ZBlk0) loadBlkData(ctx context.Context) ([]byte, zodb.Tid, error) {
...
@@ -172,7 +175,6 @@ func (zb *ZBlk0) loadBlkData(ctx context.Context) ([]byte, zodb.Tid, error) {
// ZData mimics ZData from python.
// ZData mimics ZData from python.
type
ZData
struct
{
type
ZData
struct
{
zBlkBase
// XXX -> ZBlk1, not here?
zodb
.
Persistent
zodb
.
Persistent
// XXX py source uses bytes(buf) but on python2 it still results in str
// 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 {
...
@@ -202,6 +204,7 @@ func (zd *zDataState) PySetState(pystate interface{}) error {
// ZBlk1 mimics ZBlk1 from python.
// ZBlk1 mimics ZBlk1 from python.
type
ZBlk1
struct
{
type
ZBlk1
struct
{
zBlkBase
zodb
.
Persistent
zodb
.
Persistent
chunktab
*
btree
.
IOBTree
// {} offset -> ZData(chunk)
chunktab
*
btree
.
IOBTree
// {} offset -> ZData(chunk)
...
...
wcfs/δbtail.go
View file @
be0fed1e
...
@@ -91,7 +91,7 @@ type ΔBtail struct {
...
@@ -91,7 +91,7 @@ type ΔBtail struct {
δRtail
[]
ΔRoots
// which BTree were changed; Noted only by keys ∈ tracket subset
δ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
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
db
*
zodb
.
DB
// to open connections to load new/old tree|buckets
// tracked index: BTree|Bucket -> top tree element.
// 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 {
...
@@ -153,6 +153,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) ΔF {
// take zblk changes into account
// take zblk changes into account
for
_
,
oid
:=
range
δZ
.
Changev
{
for
_
,
oid
:=
range
δZ
.
Changev
{
// XXX cache lock/unlock
// XXX cache lock/unlock
var
zcache
*
zodb
.
LiveCache
// XXX stub
obj
:=
zcache
.
Get
(
oid
)
obj
:=
zcache
.
Get
(
oid
)
if
obj
==
nil
{
if
obj
==
nil
{
//fmt.Printf("%s: not in cache\n", oid)
//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