synology_apm_repo.sdk.dedup.extent module

The plain value types a DedupFile hands out: its extents and an export’s result. A leaf module (no imports from the rest of dedup/), so chunk_walk and export_scheduler can use them without importing dedup_file, which imports both.

class synology_apm_repo.sdk.dedup.extent.ExtentKind(*values)

Bases: Enum

The kind of a DedupFile extent. ZERO (an explicit ChunkMapKind.ZERO chunk-map record) and HOLE (a gap between records) both read back as zero bytes but are counted separately: a HOLE is a sparse gap, a ZERO is recorded zero data.

DATA = 1
ZERO = 2
HOLE = 3
class synology_apm_repo.sdk.dedup.extent.DataExtent(offset, length, addr, map_num, repeat=0)

Bases: object

A DATA span: addr is the template’s starting address and the span’s chunks are drawn from its 1 + repeat repetitions of map_num chunks (ChunkAddress.advance’s carry semantics).

offset: int
length: int
addr: ChunkAddress
map_num: int
repeat: int
kind: Literal[ExtentKind.DATA]
property end: int
class synology_apm_repo.sdk.dedup.extent.GapExtent(offset, length, kind)

Bases: object

A span that reads back as zero bytes: a HOLE or a ZERO.

offset: int
length: int
kind: Literal[ExtentKind.ZERO, ExtentKind.HOLE]
property end: int
synology_apm_repo.sdk.dedup.extent.Extent = synology_apm_repo.sdk.dedup.extent.DataExtent | synology_apm_repo.sdk.dedup.extent.GapExtent

One contiguous span of a DedupFile; kind tells the two apart.

class synology_apm_repo.sdk.dedup.extent.ExportResult(bytes_written, logical_size, holes, zeros, sink_wait_seconds=0.0)

Bases: object

The outcome of one export_range() call.

Variables:
  • bytes_written (int) – Real DATA bytes written, excluding any zero-fill.

  • logical_size (int) – The exported file’s full logical size.

  • holes (int) – Total bytes of HOLE regions in the range.

  • zeros (int) – Total bytes of ZERO regions in the range.

  • sink_wait_seconds (float) – Seconds a segmented export waited for its sink to accept the next segment; 0.0 for any other sink.

bytes_written: int
logical_size: int
holes: int
zeros: int
sink_wait_seconds: float