hash: bytes
+def _run_sort_key(run: _Run):
+ return run.block_ranges[0].start
+
+
@dataclass
class _V1Run(_Run):
piece_length: int # for the entity overall
if sum(map(len, run.block_ranges)) == math.ceil(run_length / BLOCK_SIZE):
runs.append(run)
- runs.sort(key = lambda r: r.block_ranges)
+ runs.sort(key = _run_sort_key)
return runs
worklist = list(heapq.merge(
_get_v1_worklist(conn, disk_id, pg_target_ranges),
_get_v2_worklist(conn, disk_id, pg_target_ranges),
- key = lambda run: run.block_ranges,
+ key = _run_sort_key,
))
if target_ranges is not None: