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
1a28466a
Commit
1a28466a
authored
Jun 18, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
60df26bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+14
-10
No files found.
wcfs/wcfs_test.py
View file @
1a28466a
...
@@ -379,6 +379,7 @@ class tDB:
...
@@ -379,6 +379,7 @@ class tDB:
# buf if head/<zf>[blk] was accessed again after change, and was no longer
# buf if head/<zf>[blk] was accessed again after change, and was no longer
# changed, the answer is "yes"
# changed, the answer is "yes"
# XXX text
# XXX text
# XXX -> _blkLastRevAccessed ? _blkRevLastAccessed ? _blkHeadRevAccessed ?
"""
"""
def _blkHeadAccessed(t, zf, blk):
def _blkHeadAccessed(t, zf, blk):
zfAccessed = t._accessed.get(zf, {})
zfAccessed = t._accessed.get(zf, {})
...
@@ -885,14 +886,17 @@ class tSrvReq:
...
@@ -885,14 +886,17 @@ class tSrvReq:
# ---- watch setup/adjust ----
# ---- watch setup/adjust ----
# _pinAt returns which blocks needs to be pinned for zf@at.
# _pinAt returns which blocks needs to be pinned for zf@at compared to zf@head
# according to wcfs invalidation protocol.
#
#
# it does not take into account whether blocks are in cache or not and computes
# It does not take into account whether blocks are in cache or not and computes
# pins for all changes. XXX is it desired behaviour?
# pins as if all blocks @head were accesses - i.e. considering all file changes
@
func
(
tWatchLink
)
# in (at, head] range.
def
_pinAt
(
twlink
,
zf
,
at
):
# -> pin = {} blk -> rev
#
t
=
twlink
.
tdb
# The caller has to take cached/not-cached effect into account on its own
# (see tDB._accessed & friends)
@
func
(
tDB
)
def
_pinAt
(
t
,
zf
,
at
):
# -> pin = {} blk -> rev
# XXX dup in _blkData
# XXX dup in _blkData
# all changes to zf
# all changes to zf
...
@@ -950,10 +954,10 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
...
@@ -950,10 +954,10 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
pin_prev
=
{}
pin_prev
=
{}
if
at_prev
is
not
None
:
if
at_prev
is
not
None
:
assert
at_prev
<=
at
,
'TODO %s -> %s'
%
(
t
.
hat
(
at_prev
),
t
.
hat
(
at
))
assert
at_prev
<=
at
,
'TODO %s -> %s'
%
(
t
.
hat
(
at_prev
),
t
.
hat
(
at
))
pin_prev
=
t
wlink
.
_pinAt
(
zf
,
at_prev
)
pin_prev
=
t
.
_pinAt
(
zf
,
at_prev
)
assert
w
.
pinned
==
pin_prev
# XXX & blkHeadAccessedRev > w.at
assert
w
.
pinned
==
pin_prev
# XXX & blkHeadAccessedRev > w.at
pin
=
t
wlink
.
_pinAt
(
zf
,
at
)
pin
=
t
.
_pinAt
(
zf
,
at
)
if
at_prev
!=
at
and
at_prev
is
not
None
:
if
at_prev
!=
at
and
at_prev
is
not
None
:
print
(
'# pin@old: %s
\
n
# pin@new: %s'
%
(
pinstr
(
pin_prev
),
pinstr
(
pin
)))
print
(
'# pin@old: %s
\
n
# pin@new: %s'
%
(
pinstr
(
pin_prev
),
pinstr
(
pin
)))
...
@@ -991,7 +995,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
...
@@ -991,7 +995,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> ?
twlink
.
_watch
(
zf
,
at
,
pinok
,
"ok"
)
twlink
.
_watch
(
zf
,
at
,
pinok
,
"ok"
)
w
.
at
=
at
w
.
at
=
at
assert
w
.
pinned
==
t
wlink
.
_pinAt
(
zf
,
at
)
assert
w
.
pinned
==
t
.
_pinAt
(
zf
,
at
)
# stop_watch instructs wlink to stop watching the file.
# stop_watch instructs wlink to stop watching the file.
...
...
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