synology_apm_repo.sdk.dedup.pool_descriptor module¶
PoolDescriptor: a picklable recipe for rebuilding one Pool fresh
inside a worker process — the dedup-layer counterpart to
storage.store_descriptor, named to match it (both are “a picklable
descriptor + a worker-side rebuild factory for X”). Neither module depends
on the other’s caller; this one only needs a StoreDescriptor already in
hand, from whichever DedupRepo/Pool a caller is dispatching work
for — verify_reachable.py has a DedupRepo (from_repo),
export_scheduler.py only ever has a bare Pool (from_pool), since
a DedupFile/ByteRangeView exposes its own .pool, never a whole
DedupRepo.
- class synology_apm_repo.sdk.dedup.pool_descriptor.PoolDescriptor(store_descriptor, pool_root, vault_key, verify_fingerprint=False, verify_ciphertext_crc=False)¶
Bases:
objectPicklable recipe for rebuilding an equivalent
Poolin a worker process.- store_descriptor: LocalFsStoreDescriptor | S3StoreDescriptor | AzureStoreDescriptor | SmbStoreDescriptor¶
- classmethod from_repo(repo, *, verify_fingerprint=False, verify_ciphertext_crc=False)¶
Nonewhenrepo.storecan’t be reconstructed in a fresh process (an unrecognized store wrapper, or a backend built from an already-live client with no picklable recipe) — the one place a caller assembles the other four fields alongside that probe, instead of each repeating the same “calldescribe_store, checkNone, then assemble” sequence inline.
- classmethod from_pool(pool)¶
Same
None-on-undescribable-store contract asfrom_repo, for a caller (export_scheduler.py) that only ever has a bare, already-configuredPoolin hand, never a wholeDedupRepoto build a fresh one from — so, unlikefrom_repo, this mirrorspool’s own currentverify_fingerprint/verify_ciphertext_crcsettings rather than taking an explicit override for either: a worker rebuilding this pool should behave identically to it, not silently reset either flag.
- synology_apm_repo.sdk.dedup.pool_descriptor.build_worker_pool(descriptor)¶
Rebuilds a fresh
ObjectStore/DirCache/Poolfromdescriptor— called once per worker process (from aProcessPoolExecutor’s synchronousinitializer=, safe since every real backend’s constructor is synchronous and does no I/O), never once per task: the resultingPool’s own caches (bucket readers, and — whenverify_fingerprint— itsAllocationTableCache) are only worth anything if they persist across every task that worker ever runs.
- async synology_apm_repo.sdk.dedup.pool_descriptor.aclose_worker_store(store)¶
The natural counterpart to
build_worker_pool()above: best-effort release of a worker’s ownObjectStoreat shutdown — itsaiohttpconnector, forS3Store/AzureStore; a no-op forLocalFsStore/SmbStore, orNone(nothing was ever built). A second, separateisinstance(store, AsyncCloseable)check rather than a call tostorage.base.aclose_if_possible(the one every other caller —api/session.py’sSession.close(),storage/recording.py’s_InstrumentedStore.aclose()— shares): that helper propagates a close failure, but a worker’s own shutdown hook (_export_worker_shutdown/_verify_worker_shutdown) has nothing left to report a failure to, so this one swallows it instead.