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
89d48dfc
Commit
89d48dfc
authored
Jun 20, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
805c4b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+21
-21
No files found.
wcfs/wcfs_test.py
View file @
89d48dfc
...
...
@@ -168,7 +168,7 @@ class DFile:
# A BigFile opened under tDB is represented as tFile - see .open for details.
# A Watch opened under tDB is represented as tWatchLink - see .openwatch for details.
#
# The database can be mutated (via !wcfs path) with .change + .commit .
# The database can be mutated (via !wcfs
code
path) with .change + .commit .
# Current database head is represented by .head .
# The history of the changes is kept in .dFtail .
# There are various helpers to query history (.iter_revv, _blkData, _pinAt, ...)
...
...
@@ -190,14 +190,14 @@ class tDB:
t
.
tail
=
t
.
root
.
_p_jar
.
db
().
storage
.
lastTransaction
()
t
.
dFtail
=
[]
# of DF; head = dFtail[-1].rev
# when ZBigFile(s) blocks were last accessed via wcfs.
# this is updated only explicitly via ._blkaccess() .
t
.
_accessed
=
{}
# ZBigFile -> {} blk -> head(when accessed)
# fh(.wcfs/zhead) + history of zhead read from there
t
.
_wc_zheadfh
=
open
(
t
.
wc
.
mountpoint
+
"/.wcfs/zhead"
)
t
.
_wc_zheadv
=
[]
# when ZBigFile(s) blocks were last accessed via wcfs.
# this is updated only explicitly via ._blkaccess() .
t
.
_accessed
=
{}
# ZBigFile -> {} blk -> head(when accessed)
# tracked opened tFiles & tWatches
t
.
_files
=
set
()
t
.
_wlinks
=
set
()
...
...
@@ -296,27 +296,11 @@ class tDB:
assert
t
.
_read
(
"head/at"
)
==
h
(
t
.
head
)
# _blkaccess marks head/zf[blk] accessed.
# XXX place=? -> history query
def
_blkaccess
(
t
,
zf
,
blk
):
# XXX locking?
zfAccessed
=
t
.
_accessed
.
setdefault
(
zf
,
{})
zfAccessed
[
blk
]
=
t
.
head
# XXX vvv -> not what we need, think again
# _blkHeadAccessed returns whether block state corresponding to zf[blk] at
# current head was accessed.
#
# for example - if head/<zf>[blk] was accessed and later changed, the answer is "no".
# buf if head/<zf>[blk] was accessed again after change, and was no longer
# changed, the answer is "yes"
# XXX text
# XXX -> _blkLastRevAccessed ? _blkRevLastAccessed ? _blkHeadRevAccessed ?
"""
def _blkHeadAccessed(t, zf, blk):
zfAccessed = t._accessed.get(zf, {})
zfAccessed.get(blk) vs t._blkRev(zf, blk, t.head)
"""
# _path returns path for object on wcfs.
# - str: wcfs root + obj;
# - Persistent: wcfs root + (head|@<at>)/bigfile/obj
...
...
@@ -897,6 +881,22 @@ def _blkRev(t, zf, blk, at): # -> rev
_
,
rev
=
t
.
_blkData
(
zf
,
blk
,
at
)
return
rev
# XXX vvv -> not what we need, think again
# _blkHeadAccessed returns whether block state corresponding to zf[blk] at
# current head was accessed.
#
# for example - if head/<zf>[blk] was accessed and later changed, the answer is "no".
# buf if head/<zf>[blk] was accessed again after change, and was no longer
# changed, the answer is "yes"
# XXX text
# XXX -> _blkLastRevAccessed ? _blkRevLastAccessed ? _blkHeadRevAccessed ?
"""
@func(tDB)
def _blkHeadAccessed(t, zf, blk):
zfAccessed = t._accessed.get(zf, {})
zfAccessed.get(blk) vs t._blkRev(zf, blk, t.head)
"""
# _pinAt returns which blocks needs to be pinned for zf@at compared to zf@head
# according to wcfs invalidation protocol.
#
...
...
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