Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
ZEO
Commits
144499dc
Commit
144499dc
authored
17 years ago
by
Jim Fulton
Browse files
Options
Download
Email Patches
Plain Diff
Renamed blob_cache_writable to shared_blob_dir.
parent
2c570097
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+5
-5
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+3
-3
src/ZODB/component.xml
src/ZODB/component.xml
+1
-1
src/ZODB/config.py
src/ZODB/config.py
+1
-1
No files found.
src/ZEO/ClientStorage.py
View file @
144499dc
...
...
@@ -115,7 +115,7 @@ class ClientStorage(object):
wait
=
None
,
wait_timeout
=
None
,
read_only
=
0
,
read_only_fallback
=
0
,
username
=
''
,
password
=
''
,
realm
=
None
,
blob_dir
=
None
,
blob_cache_writable
=
False
):
blob_dir
=
None
,
shared_blob_dir
=
False
):
"""ClientStorage constructor.
This is typically invoked from a custom_zodb.py file.
...
...
@@ -191,7 +191,7 @@ class ClientStorage(object):
blob_dir -- directory path for blob data. 'blob data' is data that
is retrieved via the loadBlob API.
blob_cache_writable
-- Flag whether the blob_dir is a
writable
shared
shared_blob_dir
-- Flag whether the blob_dir is a
server-
shared
filesystem that should be used instead of transferring blob data over
zrpc.
...
...
@@ -322,7 +322,7 @@ class ClientStorage(object):
# XXX need to check for POSIX-ness here
self
.
blob_dir
=
blob_dir
self
.
blob_cache_writable
=
blob_cache_writable
self
.
shared_blob_dir
=
shared_blob_dir
if
blob_dir
is
not
None
:
# Avoid doing this import unless we need it, as it
# currently requires pywin32 on Windows.
...
...
@@ -895,7 +895,7 @@ class ClientStorage(object):
def
storeBlob
(
self
,
oid
,
serial
,
data
,
blobfilename
,
version
,
txn
):
"""Storage API: store a blob object."""
serials
=
self
.
store
(
oid
,
serial
,
data
,
version
,
txn
)
if
self
.
blob_cache_writable
:
if
self
.
shared_blob_dir
:
self
.
_storeBlob_shared
(
oid
,
serial
,
data
,
blobfilename
,
version
,
txn
)
else
:
...
...
@@ -970,7 +970,7 @@ class ClientStorage(object):
if
self
.
_have_blob
(
blob_filename
,
oid
,
serial
):
return
blob_filename
if
self
.
blob_cache_writable
:
if
self
.
shared_blob_dir
:
# We're using a server shared cache. If the file isn't
# here, it's not anywhere.
raise
POSKeyError
(
"No blob file"
,
oid
,
serial
)
...
...
This diff is collapsed.
Click to expand it.
src/ZEO/tests/testZEO.py
View file @
144499dc
...
...
@@ -139,7 +139,7 @@ class GenericTests(
"""Combine tests from various origins in one class."""
blob_cache_writable
=
False
shared_blob_dir
=
False
blob_cache_dir
=
None
def
setUp
(
self
):
...
...
@@ -158,7 +158,7 @@ class GenericTests(
zport
,
'1'
,
cache_size
=
20000000
,
min_disconnect_poll
=
0.5
,
wait
=
1
,
wait_timeout
=
60
,
blob_dir
=
self
.
blob_cache_dir
,
blob_cache_writable
=
self
.
blob_cache_writable
)
shared_blob_dir
=
self
.
shared_blob_dir
)
self
.
_storage
.
registerDB
(
DummyDB
())
def
tearDown
(
self
):
...
...
@@ -636,7 +636,7 @@ class BlobWritableCacheTests(GenericTests, CommonBlobTests):
def
setUp
(
self
):
self
.
blobdir
=
self
.
blob_cache_dir
=
tempfile
.
mkdtemp
()
self
.
filestorage
=
tempfile
.
mktemp
()
self
.
blob_cache_writable
=
True
self
.
shared_blob_dir
=
True
super
(
BlobWritableCacheTests
,
self
).
setUp
()
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/component.xml
View file @
144499dc
...
...
@@ -70,7 +70,7 @@
Path name to the blob cache directory.
</description>
</key>
<key
name=
"
blob-cache-writable
"
required=
"no"
default=
"no"
<key
name=
"
shared-blob-dir
"
required=
"no"
default=
"no"
datatype=
"boolean"
>
<description>
Tells whether the cache is a shared writable directory
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/config.py
View file @
144499dc
...
...
@@ -152,7 +152,7 @@ class ZEOClient(BaseConfig):
return
ClientStorage
(
L
,
blob_dir
=
self
.
config
.
blob_dir
,
blob_cache_writable
=
self
.
config
.
blob_cache_writable
,
shared_blob_dir
=
self
.
config
.
shared_blob_dir
,
storage
=
self
.
config
.
storage
,
cache_size
=
self
.
config
.
cache_size
,
name
=
self
.
config
.
name
,
...
...
This diff is collapsed.
Click to expand it.
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