Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
8388009c
Commit
8388009c
authored
Sep 27, 2019
by
Jason Madden
Committed by
GitHub
Sep 27, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #283 from zopefoundation/issue282
Make TmpStore implement its own getSize
parents
2f8cc67a
0d089b4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
CHANGES.rst
CHANGES.rst
+5
-0
src/ZODB/Connection.py
src/ZODB/Connection.py
+6
-4
No files found.
CHANGES.rst
View file @
8388009c
...
@@ -24,6 +24,11 @@
...
@@ -24,6 +24,11 @@
holds bytes as they are stored (i.e. no deserialization happens).
holds bytes as they are stored (i.e. no deserialization happens).
See `issue 207 <https://github.com/zopefoundation/ZODB/pull/207>`_.
See `issue 207 <https://github.com/zopefoundation/ZODB/pull/207>`_.
- Make a connection's savepoint storage implement its own
(approximate) ``getSize`` method instead of relying on the original
storage. Previously, this produced confusing DEBUG logging. See
`issue 282 <https://github.com/zopefoundation/ZODB/issues/282>`_.
5.5.1 (2018-10-25)
5.5.1 (2018-10-25)
==================
==================
...
...
src/ZODB/Connection.py
View file @
8388009c
...
@@ -1135,21 +1135,23 @@ class TmpStore(object):
...
@@ -1135,21 +1135,23 @@ class TmpStore(object):
def
__init__
(
self
,
storage
):
def
__init__
(
self
,
storage
):
self
.
_storage
=
storage
self
.
_storage
=
storage
for
method
in
(
for
method
in
(
'getName'
,
'new_oid'
,
'
getSize'
,
'
sortKey'
,
'getName'
,
'new_oid'
,
'sortKey'
,
'isReadOnly'
'isReadOnly'
):
):
setattr
(
self
,
method
,
getattr
(
storage
,
method
))
setattr
(
self
,
method
,
getattr
(
storage
,
method
))
self
.
_file
=
tempfile
.
TemporaryFile
(
prefix
=
'TmpStore'
)
self
.
_file
=
tempfile
.
TemporaryFile
(
prefix
=
'TmpStore'
)
# position: current file position
# position: current file position
. If objects are only stored
#
_tpos: file position at last commit point
#
once, this is approximately the byte size of object data stored.
self
.
position
=
0
self
.
position
=
0
# index: map oid to pos of last committed version
# index: map oid to pos of last committed version
self
.
index
=
{}
self
.
index
=
{}
self
.
creating
=
{}
self
.
creating
=
{}
self
.
_blob_dir
=
None
self
.
_blob_dir
=
None
def
getSize
(
self
):
return
self
.
position
def
__len__
(
self
):
def
__len__
(
self
):
return
len
(
self
.
index
)
return
len
(
self
.
index
)
...
...
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