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
75523243
Commit
75523243
authored
Nov 18, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little cleanup and an added comment.
parent
afcccf13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+18
-16
No files found.
src/ZODB/FileStorage.py
View file @
75523243
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,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.11
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.11
5
$'
[
11
:
-
2
]
import
base64
import
base64
from
cPickle
import
Pickler
,
Unpickler
,
loads
from
cPickle
import
Pickler
,
Unpickler
,
loads
...
@@ -285,6 +285,10 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -285,6 +285,10 @@ class FileStorage(BaseStorage.BaseStorage,
read_only
=
read_only
,
read_only
=
read_only
,
)
)
self
.
_ltid
=
tid
self
.
_ltid
=
tid
# self._pos should always point just past the last
# transaction. During 2PC, data is written after _pos.
# invariant is restored at tpc_abort() or tpc_finish().
self
.
_ts
=
tid
=
TimeStamp
(
tid
)
self
.
_ts
=
tid
=
TimeStamp
(
tid
)
t
=
time
.
time
()
t
=
time
.
time
()
...
@@ -402,15 +406,12 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -402,15 +406,12 @@ class FileStorage(BaseStorage.BaseStorage,
return
ltid
return
ltid
def
_restore_index
(
self
):
def
_restore_index
(
self
):
"""Load the database index from a file to support quick startup
"""Load database index to support quick startup."""
"""
try
:
file_name
=
self
.
__name__
f
=
open
(
"%s.index"
%
self
.
__name__
,
'rb'
)
index_name
=
file_name
+
'.index'
except
:
return
None
try
:
f
=
open
(
index_name
,
'rb'
)
p
=
Unpickler
(
f
)
except
:
return
None
p
=
Unpickler
(
f
)
try
:
try
:
info
=
p
.
load
()
info
=
p
.
load
()
...
@@ -419,16 +420,17 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -419,16 +420,17 @@ class FileStorage(BaseStorage.BaseStorage,
warn
(
"Failed to load database index: %s: %s"
%
warn
(
"Failed to load database index: %s: %s"
%
(
exc
,
err
))
(
exc
,
err
))
return
None
return
None
index
=
info
.
get
(
'index'
)
index
=
info
.
get
(
'index'
)
pos
=
info
.
get
(
'pos'
)
pos
=
info
.
get
(
'pos'
)
oid
=
info
.
get
(
'oid'
)
oid
=
info
.
get
(
'oid'
)
vindex
=
info
.
get
(
'vindex'
)
vindex
=
info
.
get
(
'vindex'
)
if
index
is
None
or
pos
is
None
or
oid
is
None
or
vindex
is
None
:
if
index
is
None
or
pos
is
None
or
oid
is
None
or
vindex
is
None
:
return
None
return
None
pos
=
long
(
pos
)
pos
=
long
(
pos
)
tid
=
self
.
_sane
(
index
,
pos
)
tid
=
self
.
_sane
(
index
,
pos
)
if
not
tid
:
return
None
if
not
tid
:
return
None
return
index
,
vindex
,
pos
,
oid
,
tid
return
index
,
vindex
,
pos
,
oid
,
tid
...
...
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