Package arvados :: Module _ranges
[hide private]
[frames] | no frames]

Module _ranges

source code

Classes [hide private]
  Range
  LocatorAndRange
Functions [hide private]
 
first_block(data_locators, range_start) source code
 
locators_and_ranges(data_locators, range_start, range_size, limit=None)
Get blocks that are covered by a range.
source code
 
replace_range(data_locators, new_range_start, new_range_size, new_locator, new_segment_offset)
Replace a file segment range with a new segment.
source code
Variables [hide private]
  _logger = logging.getLogger('arvados.ranges')
  RANGES_SPAM = 9
Function Details [hide private]

locators_and_ranges(data_locators, range_start, range_size, limit=None)

source code 
Get blocks that are covered by a range.

Returns a list of LocatorAndRange objects.

:data_locators:
  list of Range objects, assumes that blocks are in order and contiguous

:range_start:
  start of range

:range_size:
  size of range

:limit:
  Maximum segments to return, default None (unlimited).  Will truncate the
  result if there are more segments needed to cover the range than the
  limit.

replace_range(data_locators, new_range_start, new_range_size, new_locator, new_segment_offset)

source code 

Replace a file segment range with a new segment.

NOTE::
data_locators will be updated in place

:data_locators:
  list of Range objects, assumes that segments are in order and contiguous

:new_range_start:
  start of range to replace in data_locators

:new_range_size:
  size of range to replace in data_locators

:new_locator:
  locator for new segment to be inserted

:new_segment_offset:
  segment offset within the locator