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
1a17b63e
Commit
1a17b63e
authored
Jun 17, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge _data_find comment repair from 3.3 branch.
parent
1a7cd9e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
trunk/src/ZODB/FileStorage/FileStorage.py
trunk/src/ZODB/FileStorage/FileStorage.py
+12
-3
trunk/src/ZODB/FileStorage/fspack.py
trunk/src/ZODB/FileStorage/fspack.py
+12
-3
No files found.
trunk/src/ZODB/FileStorage/FileStorage.py
View file @
1a17b63e
...
@@ -681,9 +681,18 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -681,9 +681,18 @@ class FileStorage(BaseStorage.BaseStorage,
self
.
_lock_release
()
self
.
_lock_release
()
def
_data_find
(
self
,
tpos
,
oid
,
data
):
def
_data_find
(
self
,
tpos
,
oid
,
data
):
# Return backpointer to oid in data record for in transaction at tpos.
# Return backpointer for oid. Must call with the lock held.
# It should contain a pickle identical to data. Returns 0 on failure.
# This is a file offset to oid's data record if found, else 0.
# Must call with lock held.
# The data records in the transaction at tpos are searched for oid.
# If a data record for oid isn't found, returns 0.
# Else if oid's data record contains a backpointer, that
# backpointer is returned.
# Else oid's data record contains the data, and the file offset of
# oid's data record is returned. This data record should contain
# a pickle identical to the 'data' argument.
# XXX If the length of the stored data doesn't match len(data),
# XXX an exception is raised. If the lengths match but the data
# XXX isn't the same, 0 is returned. Why the discrepancy?
self
.
_file
.
seek
(
tpos
)
self
.
_file
.
seek
(
tpos
)
h
=
self
.
_file
.
read
(
TRANS_HDR_LEN
)
h
=
self
.
_file
.
read
(
TRANS_HDR_LEN
)
tid
,
tl
,
status
,
ul
,
dl
,
el
=
struct
.
unpack
(
TRANS_HDR
,
h
)
tid
,
tl
,
status
,
ul
,
dl
,
el
=
struct
.
unpack
(
TRANS_HDR
,
h
)
...
...
trunk/src/ZODB/FileStorage/fspack.py
View file @
1a17b63e
...
@@ -73,9 +73,18 @@ class DataCopier(FileStorageFormatter):
...
@@ -73,9 +73,18 @@ class DataCopier(FileStorageFormatter):
raise
UndoError
(
None
,
"Invalid transaction id"
)
raise
UndoError
(
None
,
"Invalid transaction id"
)
def
_data_find
(
self
,
tpos
,
oid
,
data
):
def
_data_find
(
self
,
tpos
,
oid
,
data
):
# Return backpointer to oid in data record for in transaction at tpos.
# Return backpointer for oid. Must call with the lock held.
# It should contain a pickle identical to data. Returns 0 on failure.
# This is a file offset to oid's data record if found, else 0.
# Must call with lock held.
# The data records in the transaction at tpos are searched for oid.
# If a data record for oid isn't found, returns 0.
# Else if oid's data record contains a backpointer, that
# backpointer is returned.
# Else oid's data record contains the data, and the file offset of
# oid's data record is returned. This data record should contain
# a pickle identical to the 'data' argument.
# XXX If the length of the stored data doesn't match len(data),
# XXX an exception is raised. If the lengths match but the data
# XXX isn't the same, 0 is returned. Why the discrepancy?
h
=
self
.
_read_txn_header
(
tpos
)
h
=
self
.
_read_txn_header
(
tpos
)
tend
=
tpos
+
h
.
tlen
tend
=
tpos
+
h
.
tlen
pos
=
self
.
_file
.
tell
()
pos
=
self
.
_file
.
tell
()
...
...
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