Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
8ee22408
Commit
8ee22408
authored
Jul 01, 2000
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refined iterator interface in support of moving data between storages.
parent
c6508ad3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+12
-15
No files found.
src/ZODB/FileStorage.py
View file @
8ee22408
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version
# may have a back pointer to a version record or to a non-version
# record.
# record.
#
#
__version__
=
'$Revision: 1.4
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
,
sys
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
,
sys
from
struct
import
pack
,
unpack
from
struct
import
pack
,
unpack
...
@@ -737,7 +737,7 @@ class FileStorage(BaseStorage.BaseStorage):
...
@@ -737,7 +737,7 @@ class FileStorage(BaseStorage.BaseStorage):
# OK, not clear the checkpoint flag
# OK, not clear the checkpoint flag
file
.
seek
(
pos
+
16
)
file
.
seek
(
pos
+
16
)
write
(
' '
)
write
(
self
.
_tstatus
)
file
.
flush
()
file
.
flush
()
if
fsync
is
not
None
:
if
fsync
is
not
None
:
...
@@ -1718,7 +1718,6 @@ class FileIterator(Iterator):
...
@@ -1718,7 +1718,6 @@ class FileIterator(Iterator):
file
.
seek
(
0
,
2
)
file
.
seek
(
0
,
2
)
self
.
_file_size
=
file
.
tell
()
self
.
_file_size
=
file
.
tell
()
self
.
_pos
=
4
self
.
_pos
=
4
self
.
_index
=
{}
def
next
(
self
,
index
=
0
):
def
next
(
self
,
index
=
0
):
file
=
self
.
_file
file
=
self
.
_file
...
@@ -1792,16 +1791,14 @@ class FileIterator(Iterator):
...
@@ -1792,16 +1791,14 @@ class FileIterator(Iterator):
pos
=
tpos
+
23
+
ul
+
dl
+
el
pos
=
tpos
+
23
+
ul
+
dl
+
el
user
=
read
(
ul
)
user
=
read
(
ul
)
description
=
read
(
dl
)
description
=
read
(
dl
)
d
=
{}
if
el
:
if
el
:
try
:
try
:
e
=
loads
(
read
(
el
))
e
=
loads
(
read
(
el
))
except
:
e
=
{}
d
.
update
(
e
)
else
:
e
=
{}
except
:
pass
result
=
RecordIterator
(
result
=
RecordIterator
(
tid
,
user
,
description
,
d
,
tid
,
status
,
user
,
description
,
e
,
pos
,
(
tend
,
file
,
seek
,
read
,
pos
,
(
tend
,
file
,
seek
,
read
,
self
.
_index
,
self
.
_index
.
get
,
tpos
,
tpos
,
)
)
)
)
...
@@ -1824,8 +1821,9 @@ class FileIterator(Iterator):
...
@@ -1824,8 +1821,9 @@ class FileIterator(Iterator):
class
RecordIterator
(
Iterator
):
class
RecordIterator
(
Iterator
):
"""Iterate over the transactions in a FileStorage file.
"""Iterate over the transactions in a FileStorage file.
"""
"""
def
__init__
(
self
,
tid
,
user
,
desc
,
ext
,
pos
,
stuff
):
def
__init__
(
self
,
tid
,
status
,
user
,
desc
,
ext
,
pos
,
stuff
):
self
.
tid
=
tid
self
.
tid
=
tid
self
.
status
=
status
self
.
user
=
user
self
.
user
=
user
self
.
description
=
desc
self
.
description
=
desc
self
.
_extension
=
ext
self
.
_extension
=
ext
...
@@ -1835,7 +1833,7 @@ class RecordIterator(Iterator):
...
@@ -1835,7 +1833,7 @@ class RecordIterator(Iterator):
def
next
(
self
,
index
=
0
):
def
next
(
self
,
index
=
0
):
name
=
''
name
=
''
pos
=
self
.
_pos
pos
=
self
.
_pos
tend
,
file
,
seek
,
read
,
_index
,
get
,
tpos
=
self
.
_stuff
tend
,
file
,
seek
,
read
,
tpos
=
self
.
_stuff
while
pos
<
tend
:
while
pos
<
tend
:
# Read the data records for this transaction
# Read the data records for this transaction
...
@@ -1867,8 +1865,7 @@ class RecordIterator(Iterator):
...
@@ -1867,8 +1865,7 @@ class RecordIterator(Iterator):
p
=
read
(
8
)
p
=
read
(
8
)
p
=
_loadBack
(
file
,
oid
,
p
)[
0
]
p
=
_loadBack
(
file
,
oid
,
p
)[
0
]
r
=
Record
(
oid
,
get
(
oid
,
None
),
serial
,
version
,
p
)
r
=
Record
(
oid
,
serial
,
version
,
p
)
_index
[
oid
]
=
serial
return
r
return
r
...
@@ -1879,4 +1876,4 @@ class Record:
...
@@ -1879,4 +1876,4 @@ class Record:
"""An abstract database record
"""An abstract database record
"""
"""
def
__init__
(
self
,
*
args
):
def
__init__
(
self
,
*
args
):
self
.
oid
,
self
.
old
,
self
.
serial
,
self
.
version
,
self
.
p
=
args
self
.
oid
,
self
.
serial
,
self
.
version
,
self
.
data
=
args
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