18941: Separate get() behavior for prefetch
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 29 Mar 2022 20:52:47 +0000 (16:52 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 29 Mar 2022 20:52:47 +0000 (16:52 -0400)
commita46914b92aaae9b9d8eae4021d28360abf835a76
treea075d3b14d7da7fd9f9a9752a9419c647ee66d91
parent0e83a8971942943e79dfc1b064b5bac0cc82217f
18941: Separate get() behavior for prefetch

Add flag to get() which causes it to return None immediately if a cache
slot already exists for a block.

In the standard behavior, if multiple readers try to get() the same
block, the first one will start downloading the block, and all the
others will wait and return the block content from the cache slot
when complete.

With the new optional behavior, if multiple readers try to get() the same
block, the first one will start downloading the block, and all the
others will immediately return None.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
sdk/python/arvados/arvfile.py
sdk/python/arvados/keep.py