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
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 {
}
// /bigfile/<bigfileX>/head/at -> readAt serves read.
func
(
bf
*
BigFile
)
readAt
()
[]
byte
{
// XXX locking
// XXX zbf.PJar() not good if we want to share objects between connections?
return
[]
byte
(
bf
.
zbf
.
PJar
()
.
At
()
.
String
())
// /(head|<rev>)/at -> readAt serves read.
func
(
h
*
Head
)
readAt
()
[]
byte
{
// XXX implemented only for Head, not Rev
root
:=
groot
root
.
zheadMu
.
Lock
()
defer
root
.
zheadMu
.
Unlock
()
return
[]
byte
(
root
.
zhead
.
At
()
.
String
())
}
...
...
@@ -1108,6 +1110,7 @@ func main() {
Node
:
nodefs
.
NewDefaultNode
(),
tab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
})
mkfile
(
head
,
"at"
,
NewSmallFile
(
head
.
readAt
))
// TODO mtime(at) = tidtime(at)
// TODO handle autoexit
_
=
autoexit
...
...
wcfs/wcfs_test.py
View file @
84fe9dcc
...
...
@@ -165,8 +165,9 @@ def test_bigfile_empty():
wc
=
wcfs
.
join
(
testzurl
,
autostart
=
True
)
defer
(
wc
.
close
)
# path to head/bigfile/ under wcfs
bigpath
=
wc
.
mountpoint
+
"/head/bigfile"
# path to head/ and head/bigfile/ under wcfs
head
=
wc
.
mountpoint
+
"/head"
bigpath
=
head
+
"/bigfile"
# lookup to non-BigFile - must be rejected
with
raises
(
OSError
)
as
exc
:
...
...
@@ -182,7 +183,7 @@ def test_bigfile_empty():
assert
st
.
st_mtime
==
tidtime
(
tid1
)
# 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
...
...
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