synology_apm_repo.sdk.units.content.local_file module¶
LocalFileContentSource — a ContentSource over one plain store
file, outside the dedup layer.
- class synology_apm_repo.sdk.units.content.local_file.LocalFileContentSource(store, path, size)¶
Bases:
objectA
ContentSourcereading a file directly from the store, not through the dedup layer — for the non-dedup descriptor files (.vmx/.vmdkheaders/.delta) undercopy_meta_file/<dir>/.Build one with
create: a caller-unknown size is resolved viastore.size()there, sincesizemust stay a sync property.- async classmethod create(store, path, size)¶
- async read(offset=0, length=None)¶
- stream(block=8388608)¶
- async export_range(writer, start, end, *, sparse=True, progress=None, tuning=None)¶
Copies the range block by block: always a full, non-sparse write regardless of
sparse.- Raises:
ValueError – The range is not inside the file.
FormatError – The store file is shorter than
size.
- async planned_bytes(start, end)¶