From 438752b8a79d58a615e51bd5ddcbea74b1452a63 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 2 Feb 2015 10:19:57 -0500 Subject: [PATCH] 4823: Added SYNC mode constants. --- sdk/python/arvados/collection.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py index 682880359c..c09520ea9f 100644 --- a/sdk/python/arvados/collection.py +++ b/sdk/python/arvados/collection.py @@ -645,10 +645,18 @@ class Collection(CollectionBase): sub-collections. """ - def __init__(self, manifest_locator_or_text=None, parent=None, api_client=None, - keep_client=None, num_retries=0, block_manager=None): - """ - :manifest_locator_or_text: + SYNC_READONLY = 1 + SYNC_EXPLICIT = 2 + SYNC_LIVE = 3 + + def __init__(self, manifest_locator_or_text=None, + parent=None, + api_client=None, + keep_client=None, + num_retries=0, + block_manager=None, + sync=Collection.SYNC_READONLY): + """:manifest_locator_or_text: One of Arvados collection UUID, block locator of a manifest, raw manifest text, or None (to create an empty collection). :parent: @@ -662,7 +670,16 @@ class Collection(CollectionBase): :block_manager: the block manager to use. If None, use parent's block manager or create one. - + :sync: + Desired synchronization policy with API server collection record. + :SYNC_READONLY: + Collection is read only. No synchronization. This mode will + also forego locking, which gives better performance. + :SYNC_EXPLICIT: + Synchronize on explicit request via `merge()` or `save()` + :SYNC_LIVE: + Synchronize with server in response to background websocket events, + on block write, or on file close. """ self.parent = parent -- 2.39.5