synology_apm_repo.sdk.units.verify_extents module¶
Per-workload-type extent resolution for verify_reachable: turns a
Version into the CompositionExtent``(s) its content actually lives
in, reusing each workload type's own already-implemented resolution
(``DeviceProvider/FsProvider/SaasStream) rather than re-deriving
any path/SQL logic. Feeds into units.verify_reachable’s top-down walk,
which runs FULL or QUICK checks (see VerifyLevel) against the buckets
these extents resolve to.
- class synology_apm_repo.sdk.units.verify_extents.CompositionExtent(dedup_file, start, end, unit_label)¶
Bases:
objectOne composition record’s byte range a
Version’s own content lives in —[start, end)withindedup_file, which already exposes its own(stream_id, session_id, comp_offset)triple directly (DedupFile.stream_id/.session_id/.comp_offset), so this doesn’t duplicate those fields. A VM/FS/SaaS version has exactly one of these; a PC/PS version has one per disk fragment.
- async synology_apm_repo.sdk.units.verify_extents.composition_extents_for_version(repo, workload, version, saas_streams)¶
Every composition record this version’s own content lives in — one for a VM/FS/SaaS version’s single dedup image/stream, one per disk fragment for a PC/PS version. Reuses each workload type’s own, already-implemented resolution (
DeviceProvider/FsProvider/SaasStreamviasaas_streams, the exact machinery real browsing uses) rather than re-deriving any path/SQL logic — this function is a thin adapter over each, not a second implementation of “how does a version’s content resolve.”saas_streamsis the caller’s own run-scopedSaasStreamCache(_ReachabilityWalkerowns one) — GW/M365’s own forward-resolution caching (seeunits.saas.stream) only pays off when every version sharing a stream resolves through the sameSaasStreaminstance, not a fresh one per call.Deliberately does not recurse into a device version’s guest filesystem (
DiskFsSibling) or a SaaS version’s individual Mail/Drive/Calendar items: both are byte-range/offset views into the same composition record(s) this function already returns, so walking them would only re-touch chunks already covered — a device provider’s own node tree is shallow (root → children already are the leaf disks).Returns
(extents, findings): a VM/PC-PS version has more than one disk/fragment, and one of them failing to resolve must not discard every other disk’s already-resolved content the same way every other stage in this module already treats a partial failure (seeunits.verify_reachable._ReachabilityWalker._discover_extent’s own chunk-map-walkexceptclause) — so a per-disk resolution failure is folded intofindingsinstead of raised, and every other disk keeps its own place inextents. FS/SaaS always return an emptyfindings(a single dedup image/stream, nothing to be partial about).- Raises:
ApmRepoError – This version’s metadata claims it should resolve to real content but doesn’t resolve at all — the caller (
verify_reachable) turns this into aStage.VERSIONFindingrather than silently skipping the version.