synology_apm_repo.sdk.dedup.fingerprint module

Fingerprint lookup: locates the stored SHA-256 digests of a bucket’s chunks in its group’s .inf/.fgp files (FORMAT-SPEC.md: Sidecar files), for a Pool whose VerifyPolicy.fingerprint is on.

Group path indirection: .inf/.fgp are shared by an entire 1024-bucket group, keyed by the group’s starting bucket id (bucket_id & ~1023) — the same 10-bit layering scheme as .buk paths. .fgp is further split into 4 MiB segments (<prefix>_<segIdx>.fgp) since a full group’s fingerprint data (1024 buckets * up to 8192 chunks * 32 bytes) would otherwise be one multi-hundred-MB file.

``FingerprintIndex`` reads a group’s whole .inf allocation table once and answers every later bucket in it from memory: up to GROUP_BUCKET_NUM (1024) buckets share one group’s table.

class synology_apm_repo.sdk.dedup.fingerprint.FingerprintIndex(store, dir_cache, pool_root, *, maxsize=256)

Bases: object

The stored SHA-256 fingerprints of one pool’s chunks, looked up through each group’s .inf allocation table, cached per (stream_id, group's starting bucket id) and LRU-bounded by maxsize tables (8 KiB each).

stats()

Counters of the allocation-table cache.

clear()

Drop every cached allocation table (see Pool.release_caches).

async digests(stream_id, bucket_id, chunk_indices)

The stored 32-byte digest of every chunk_idx in chunk_indices of one bucket. Reads each maximal run of consecutive indices within one .fgp segment with one store.read(); scattered indices cost one read each.

Raises:
  • NotFoundError – The group’s .inf or .fgp file is missing.

  • DataCorruptError – A chunk index is beyond this bucket’s recorded fingerprint count, or the .inf header fails validation.

  • FormatError – The .inf or .fgp file is truncated.