summaryrefslogtreecommitdiff
path: root/obnamlib/fmt_ga/client.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/client.py
parent6deaca063da5260477a4bcdac78fd18f44cd538d (diff)
downloadobnam-f8a1272c89366177672089e54948e7c1f45af5f5.tar.gz
Add green-albatross cache settings
Diffstat (limited to 'obnamlib/fmt_ga/client.py')
-rw-r--r--obnamlib/fmt_ga/client.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index d2a91946..d07bea77 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -37,6 +37,8 @@ class GAClient(object):
self._client_keys = GAKeys()
self._generations = GAGenerationList()
self._data_is_loaded = False
+ self._dir_cache_size = obnamlib.DEFAULT_DIR_CACHE_BYTES
+ self._dir_bag_size = obnamlib.DEFAULT_DIR_BAG_BYTES
def set_current_time(self, current_time):
self._current_time = current_time
@@ -44,6 +46,16 @@ class GAClient(object):
def set_fs(self, fs):
self._fs = fs
+ def set_dir_bag_size(self, size):
+ self._dir_bag_size = size
+ if self._blob_store:
+ self._blob_store.set_max_bag_size(self._dir_bag_size)
+
+ def set_dir_cache_size(self, size):
+ self._dir_cache_size = size
+ if self._blob_store:
+ self._blob_store.set_max_cache_bytes(self._dir_cache_size)
+
def set_dirname(self, dirname):
self._dirname = dirname
@@ -79,9 +91,8 @@ class GAClient(object):
self._blob_store = obnamlib.BlobStore()
self._blob_store.set_bag_store(bag_store)
- self._blob_store.set_max_bag_size(obnamlib.DEFAULT_NODE_SIZE)
- self._blob_store.set_max_cache_bytes(
- obnamlib.DEFAULT_DIR_OBJECT_CACHE_BYTES)
+ self._blob_store.set_max_bag_size(self._dir_bag_size)
+ self._blob_store.set_max_cache_bytes(self._dir_cache_size)
return self._blob_store
def _save_per_client_data(self):