[Zodb-checkins] SVN: ZODB/branches/hannosch-pickle-protocol2/src/ZEO/ Cover the index used for the ClientCache
Hanno Schlichting
hannosch at hannosch.eu
Sat May 1 09:52:58 EDT 2010
Log message for revision 111825:
Cover the index used for the ClientCache
Changed:
U ZODB/branches/hannosch-pickle-protocol2/src/ZEO/ClientStorage.py
U ZODB/branches/hannosch-pickle-protocol2/src/ZEO/cache.py
-=-
Modified: ZODB/branches/hannosch-pickle-protocol2/src/ZEO/ClientStorage.py
===================================================================
--- ZODB/branches/hannosch-pickle-protocol2/src/ZEO/ClientStorage.py 2010-05-01 13:47:37 UTC (rev 111824)
+++ ZODB/branches/hannosch-pickle-protocol2/src/ZEO/ClientStorage.py 2010-05-01 13:52:57 UTC (rev 111825)
@@ -401,7 +401,8 @@
else:
cache_path = None
- self._cache = self.ClientCacheClass(cache_path, size=cache_size)
+ self._cache = self.ClientCacheClass(
+ cache_path, size=cache_size, pickle_protocol=pickle_protocol)
self._blob_cache_size = blob_cache_size
self._blob_data_bytes_loaded = 0
Modified: ZODB/branches/hannosch-pickle-protocol2/src/ZEO/cache.py
===================================================================
--- ZODB/branches/hannosch-pickle-protocol2/src/ZEO/cache.py 2010-05-01 13:47:37 UTC (rev 111824)
+++ ZODB/branches/hannosch-pickle-protocol2/src/ZEO/cache.py 2010-05-01 13:52:57 UTC (rev 111825)
@@ -152,7 +152,7 @@
# default of 20MB. The default here is misleading, though, since
# ClientStorage is the only user of ClientCache, and it always passes an
# explicit size of its own choosing.
- def __init__(self, path=None, size=200*1024**2):
+ def __init__(self, path=None, size=200*1024**2, pickle_protocol=1):
# - `path`: filepath for the cache file, or None (in which case
# a temp file will be created)
@@ -163,11 +163,14 @@
size = max(size, ZEC_HEADER_SIZE)
self.maxsize = size
+ # The pickle protocol to use
+ self._pickle_protocol = pickle_protocol
+
# The number of records in the cache.
self._len = 0
# {oid -> pos}
- self.current = ZODB.fsIndex.fsIndex()
+ self.current = ZODB.fsIndex.fsIndex(pickle_protocol=pickle_protocol)
# {oid -> {tid->pos}}
# Note that caches in the wild seem to have very little non-current
@@ -252,7 +255,8 @@
# Remember the location of the largest free block. That seems a
# decent place to start currentofs.
- self.current = ZODB.fsIndex.fsIndex()
+ self.current = ZODB.fsIndex.fsIndex(
+ pickle_protocol=self._pickle_protocol)
self.noncurrent = BTrees.LOBTree.LOBTree()
l = 0
last = ofs = ZEC_HEADER_SIZE
More information about the Zodb-checkins
mailing list