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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
bba0bed0
Commit
bba0bed0
authored
Aug 27, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document record offsets.
In checkSize(), delete the half of the index that's no longer valid.
parent
835ad7d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
src/ZEO/ClientCache.py
src/ZEO/ClientCache.py
+24
-14
No files found.
src/ZEO/ClientCache.py
View file @
bba0bed0
...
...
@@ -32,30 +32,35 @@ None.
Each cache file has a 4-byte magic number followed by a sequence of
records of the form:
o
id -- 8-byte object id
o
ffset in record: name -- description
status -- 1-byte status 'v': valid, 'n': non-version valid, 'i': inval
id
0: oid -- 8-byte object
id
tlen -- 4-byte (unsigned) record length
8: status -- 1-byte status 'v': valid, 'n': non-version valid, 'i': invalid
vlen -- 2-bute (unsigned) version
length
9: tlen -- 4-byte (unsigned) record
length
dlen -- 4-byte length of non-version data
13: vlen -- 2-byte (unsigned) version length
serial -- 8-byte non-version serial (timestamp)
15: dlen -- 4-byte length of non-version data
data -- non-version data
19: serial -- 8-byte non-version serial (timestamp)
version -- Version string (if vlen > 0)
27: data -- non-version data
vdlen -- 4-byte length of version data
(if vlen > 0)
27+dlen: version -- Version string
(if vlen > 0)
vdata --
version data (if vlen > 0)
27+dlen+vlen: vdlen -- 4-byte length of
version data (if vlen > 0)
vserial -- 8-byte version serial (timestamp)
(if vlen > 0)
31+dlen+vlen: vdata -- version data
(if vlen > 0)
tlen -- 4-byte (unsigned) record length (for redundancy and backward
traversal)
31+dlen+vlen+vdlen: vserial -- 8-byte version serial (timestamp)
(if vlen > 0)
39+dlen+vlen+vdlen: tlen -- 4-byte (unsigned) record length (for
redundancy and backward traversal)
43+dlen+vlen+vdlen: -- total record length (equal to tlen)
There is a cache size limit.
...
...
@@ -88,7 +93,7 @@ file 0 and file 1.
"""
__version__
=
"$Revision: 1.2
7
$"
[
11
:
-
2
]
__version__
=
"$Revision: 1.2
8
$"
[
11
:
-
2
]
import
os
import
sys
...
...
@@ -347,6 +352,11 @@ class ClientCache:
if
self
.
_pos
+
size
>
self
.
_limit
:
current
=
not
self
.
_current
self
.
_current
=
current
# Delete the half of the index that's no longer valid
index
=
self
.
_index
for
oid
in
index
.
keys
():
if
(
index
[
oid
]
<
0
)
==
current
:
del
index
[
oid
]
if
self
.
_p
[
current
]
is
not
None
:
# Persistent cache file:
# Note that due to permission madness, waaa,
...
...
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