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
84fe9dcc
Commit
84fe9dcc
authored
Dec 25, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bdd6be33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
wcfs/wcfs.go
wcfs/wcfs.go
+8
-5
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+4
-3
No files found.
wcfs/wcfs.go
View file @
84fe9dcc
...
@@ -1012,11 +1012,13 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) error {
...
@@ -1012,11 +1012,13 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) error {
}
}
// /bigfile/<bigfileX>/head/at -> readAt serves read.
// /(head|<rev>)/at -> readAt serves read.
func
(
bf
*
BigFile
)
readAt
()
[]
byte
{
func
(
h
*
Head
)
readAt
()
[]
byte
{
// XXX locking
// XXX implemented only for Head, not Rev
// XXX zbf.PJar() not good if we want to share objects between connections?
root
:=
groot
return
[]
byte
(
bf
.
zbf
.
PJar
()
.
At
()
.
String
())
root
.
zheadMu
.
Lock
()
defer
root
.
zheadMu
.
Unlock
()
return
[]
byte
(
root
.
zhead
.
At
()
.
String
())
}
}
...
@@ -1108,6 +1110,7 @@ func main() {
...
@@ -1108,6 +1110,7 @@ func main() {
Node
:
nodefs
.
NewDefaultNode
(),
Node
:
nodefs
.
NewDefaultNode
(),
tab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
tab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
})
})
mkfile
(
head
,
"at"
,
NewSmallFile
(
head
.
readAt
))
// TODO mtime(at) = tidtime(at)
// TODO handle autoexit
// TODO handle autoexit
_
=
autoexit
_
=
autoexit
...
...
wcfs/wcfs_test.py
View file @
84fe9dcc
...
@@ -165,8 +165,9 @@ def test_bigfile_empty():
...
@@ -165,8 +165,9 @@ def test_bigfile_empty():
wc
=
wcfs
.
join
(
testzurl
,
autostart
=
True
)
wc
=
wcfs
.
join
(
testzurl
,
autostart
=
True
)
defer
(
wc
.
close
)
defer
(
wc
.
close
)
# path to head/bigfile/ under wcfs
# path to head/ and head/bigfile/ under wcfs
bigpath
=
wc
.
mountpoint
+
"/head/bigfile"
head
=
wc
.
mountpoint
+
"/head"
bigpath
=
head
+
"/bigfile"
# lookup to non-BigFile - must be rejected
# lookup to non-BigFile - must be rejected
with
raises
(
OSError
)
as
exc
:
with
raises
(
OSError
)
as
exc
:
...
@@ -182,7 +183,7 @@ def test_bigfile_empty():
...
@@ -182,7 +183,7 @@ def test_bigfile_empty():
assert
st
.
st_mtime
==
tidtime
(
tid1
)
assert
st
.
st_mtime
==
tidtime
(
tid1
)
# head/at = last txn of whole db
# head/at = last txn of whole db
assert
readfile
(
fpath
+
"/head
/at"
)
==
tid2
.
encode
(
'hex'
)
assert
readfile
(
head
+
"
/at"
)
==
tid2
.
encode
(
'hex'
)
# TODO check head/at syncs to later non-bigfile commits
# TODO check head/at syncs to later non-bigfile commits
...
...
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