summaryrefslogtreecommitdiff
path: root/obnamlib/fmt_ga/chunk_store.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-12-06 09:52:21 +0100
committerLars Wirzenius <liw@liw.fi>2015-12-06 10:43:55 +0100
commitf8a1272c89366177672089e54948e7c1f45af5f5 (patch)
treef5f83a374ba1cad78ae8f80f2bed468dc9395cb2 /obnamlib/fmt_ga/chunk_store.py
parent6deaca063da5260477a4bcdac78fd18f44cd538d (diff)
downloadobnam-f8a1272c89366177672089e54948e7c1f45af5f5.tar.gz
Add green-albatross cache settings
Diffstat (limited to 'obnamlib/fmt_ga/chunk_store.py')
-rw-r--r--obnamlib/fmt_ga/chunk_store.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/obnamlib/fmt_ga/chunk_store.py b/obnamlib/fmt_ga/chunk_store.py
index df0ca4c8..dcb920bb 100644
--- a/obnamlib/fmt_ga/chunk_store.py
+++ b/obnamlib/fmt_ga/chunk_store.py
@@ -25,6 +25,7 @@ class GAChunkStore(object):
self._fs = None
self._dirname = 'chunk-store'
self._max_chunk_size = None
+ self._chunk_cache_size = obnamlib.DEFAULT_CHUNK_CACHE_BYTES
self._bag_store = None
self._blob_store = None
@@ -35,8 +36,7 @@ class GAChunkStore(object):
self._bag_store.set_location(fs, self._dirname)
self._blob_store = obnamlib.BlobStore()
self._blob_store.set_bag_store(self._bag_store)
- self._blob_store.set_max_cache_bytes(
- obnamlib.DEFAULT_CHUNK_CACHE_BYTES)
+ self._blob_store.set_max_cache_bytes(self._chunk_cache_size)
if self._max_chunk_size is not None:
self._blob_store.set_max_bag_size(self._max_chunk_size)
@@ -45,6 +45,11 @@ class GAChunkStore(object):
if self._blob_store:
self._blob_store.set_max_bag_size(max_chunk_size)
+ def set_chunk_cache_size(self, chunk_cache_size):
+ self._chunk_cache_size = chunk_cache_size
+ if self._blob_store:
+ self._blob_store.set_max_cache_bytes(chunk_cache_size)
+
def put_chunk_content(self, content):
self._fs.create_and_init_toplevel(self._dirname)
return self._blob_store.put_blob(content)