Commit acef3571 authored by Julien Muchembled's avatar Julien Muchembled

client: new 'cache-size' Storage option

parent 9c56e9cd
......@@ -59,7 +59,8 @@ class Application(ThreadedApplication):
# is unreachable.
max_reconnection_to_master = float('inf')
def __init__(self, master_nodes, name, compress=True, **kw):
def __init__(self, master_nodes, name, compress=True, cache_size=None,
**kw):
super(Application, self).__init__(parseMasterList(master_nodes),
name, **kw)
# Internal Attributes common to all thread
......@@ -69,7 +70,8 @@ class Application(ThreadedApplication):
self.trying_master_node = None
# no self-assigned UUID, primary master will supply us one
self._cache = ClientCache()
self._cache = ClientCache() if cache_size is None else \
ClientCache(max_size=cache_size)
self._loading_oid = None
self.new_oid_list = ()
self.last_oid = '\0' * 8
......
......@@ -32,6 +32,13 @@
Log debugging information to specified SQLite DB.
</description>
</key>
<key name="cache-size" datatype="byte-size" default="20MB">
<description>
Storage cache size in bytes. Records are cached uncompressed.
Optional ``KB``, ``MB`` or ``GB`` suffixes can (and usually are)
used to specify units other than bytes.
</description>
</key>
<key name="dynamic_master_list" datatype="existing-dirpath">
<description>
The file designated by this option contains an updated list of master
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment