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
Kirill Smelkov
ZODB
Commits
17b226b2
Commit
17b226b2
authored
Jun 18, 2016
by
Jim Fulton
Committed by
GitHub
Jun 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71 from zopefoundation/move-load-to-IMVCCStorage
Move load to imvcc storage
parents
965bf84a
5b810fa0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
36 deletions
+18
-36
src/ZODB/Connection.py
src/ZODB/Connection.py
+3
-3
src/ZODB/DB.py
src/ZODB/DB.py
+1
-1
src/ZODB/ExportImport.py
src/ZODB/ExportImport.py
+1
-1
src/ZODB/interfaces.py
src/ZODB/interfaces.py
+11
-29
src/ZODB/mvccadapter.py
src/ZODB/mvccadapter.py
+2
-2
No files found.
src/ZODB/Connection.py
View file @
17b226b2
...
...
@@ -230,7 +230,7 @@ class Connection(ExportImport, object):
if
obj
is
not
None
:
return
obj
p
,
_
=
self
.
_storage
.
load
(
oid
,
''
)
p
,
_
=
self
.
_storage
.
load
(
oid
)
obj
=
self
.
_reader
.
getGhost
(
p
)
# Avoid infiniate loop if obj tries to load its state before
...
...
@@ -755,7 +755,7 @@ class Connection(ExportImport, object):
raise
try
:
p
,
serial
=
self
.
_storage
.
load
(
oid
,
''
)
p
,
serial
=
self
.
_storage
.
load
(
oid
)
self
.
_load_count
+=
1
...
...
@@ -1100,7 +1100,7 @@ class TmpStore:
def
load
(
self
,
oid
,
version
=
''
):
pos
=
self
.
index
.
get
(
oid
)
if
pos
is
None
:
return
self
.
_storage
.
load
(
oid
,
''
)
return
self
.
_storage
.
load
(
oid
)
self
.
_file
.
seek
(
pos
)
h
=
self
.
_file
.
read
(
8
)
oidlen
=
u64
(
h
)
...
...
src/ZODB/DB.py
View file @
17b226b2
...
...
@@ -448,7 +448,7 @@ class DB(object):
try
:
try
:
temp_storage
.
poll_invalidations
()
temp_storage
.
load
(
z64
,
''
)
temp_storage
.
load
(
z64
)
except
KeyError
:
# Create the database's root in the storage if it doesn't exist
from
persistent.mapping
import
PersistentMapping
...
...
src/ZODB/ExportImport.py
View file @
17b226b2
...
...
@@ -48,7 +48,7 @@ class ExportImport:
continue
done_oids
[
oid
]
=
True
try
:
p
,
serial
=
load
(
oid
,
''
)
p
,
serial
=
load
(
oid
)
except
:
logger
.
debug
(
"broken reference for oid %s"
,
repr
(
oid
),
exc_info
=
True
)
...
...
src/ZODB/interfaces.py
View file @
17b226b2
...
...
@@ -313,7 +313,7 @@ class IStorageWrapper(Interface):
there would be so many that it would be inefficient to do so.
"""
def
invalidate
(
transaction_id
,
oids
,
version
=
''
):
def
invalidate
(
transaction_id
,
oids
):
"""Invalidate object ids committed by the given transaction
The oids argument is an iterable of object identifiers.
...
...
@@ -551,34 +551,6 @@ class IStorage(Interface):
This is used soley for informational purposes.
"""
def
load
(
oid
,
version
):
"""Load data for an object id
NOTE: This method is deprecated and may be removed in the
future. It is no longer used by ZODB, although it may still
be used in some tests or scripts. Previously, there was a
requirement that load results be properly ordered with
invalidations so that at any point in time, clients have a
consistent view of what version of an object is current. This
restriction has been relaxed and some storages will be
simplified as a result of the removal of this requirement.
An alternative to calling load is calling loadBefore passing
ZODB.utils.maxtid::
store.loadBefore(oid, ZODB.utils.maxtid)
The version argumement should always be an empty string. It
exists soley for backward compatibility with older storage
implementations.
A data record and serial are returned. The serial is a
transaction identifier of the transaction that wrote the data
record.
A POSKeyError is raised if there is no record for the object id.
"""
def
loadBefore
(
oid
,
tid
):
"""Load the object data written before a transaction id
...
...
@@ -1094,6 +1066,16 @@ class IMVCCStorage(IStorage):
the frequency of database polls, thus reducing database load.
"""
def
load
(
oid
):
"""Load current data for an object id
A data record and serial are returned. The serial is a
transaction identifier of the transaction that wrote the data
record.
A POSKeyError is raised if there is no record for the object id.
"""
class
IStorageCurrentRecordIteration
(
IStorage
):
...
...
src/ZODB/mvccadapter.py
View file @
17b226b2
...
...
@@ -75,7 +75,7 @@ class MVCCAdapter(Base):
for
instance
in
self
.
_instances
:
instance
.
_invalidateCache
()
def
invalidate
(
self
,
transaction_id
,
oids
,
version
=
''
):
def
invalidate
(
self
,
transaction_id
,
oids
):
with
self
.
_lock
:
for
instance
in
self
.
_instances
:
instance
.
_invalidate
(
oids
)
...
...
@@ -139,7 +139,7 @@ class MVCCAdapterInstance(Base):
self
.
_invalidations
.
clear
()
return
result
def
load
(
self
,
oid
,
version
=
''
):
def
load
(
self
,
oid
):
assert
self
.
_start
is
not
None
r
=
self
.
_storage
.
loadBefore
(
oid
,
self
.
_start
)
if
r
is
None
:
...
...
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