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. Built from a live Pool (from_pool).
- class synology_apm_repo.sdk.dedup.pool_descriptor.PoolDescriptor(store_descriptor, pool_root, vault_key, verify=VerifyPolicy(ciphertext_crc=False, fingerprint=False), limits=CacheLimits(bucket_readers=16, bucket_readers_interactive=64, chunks=4096, composition_records=64, composition_pages=128, saas_streams=8, dir_scan=256, dir_fixed=64, allocation_tables=256, forward_resolutions=4096))¶
Bases:
objectPicklable recipe for rebuilding an equivalent
Poolin a worker process (build_worker_pool).- store_descriptor: LocalFsStoreDescriptor | S3StoreDescriptor | AzureStoreDescriptor | SmbStoreDescriptor¶
- verify: VerifyPolicy¶
- limits: CacheLimits¶
- classmethod from_pool(pool)¶
pool’s recipe,verifypolicy and cache limits included.Nonewhen its store can’t be reconstructed in a fresh process (an unrecognized store wrapper, or a backend built from an already-live client with no picklable recipe).
- synology_apm_repo.sdk.dedup.pool_descriptor.build_worker_pool(descriptor)¶
Rebuilds a fresh
ObjectStore/DirCache/Poolfromdescriptor; call it once per worker process, not per task, so thePool’s caches persist across tasks (WorkerContext.init).
- async synology_apm_repo.sdk.dedup.pool_descriptor.close_worker_store(store)¶
Best-effort release of a worker’s
ObjectStoreat shutdown: a close failure is swallowed, since a shutdown hook has nowhere to report it.
- class synology_apm_repo.sdk.dedup.pool_descriptor.SupportsWorkerPool(*args, **kwargs)¶
Bases:
ProtocolContent an export may decode in worker processes: it can describe the
Poola worker rebuilds to read it.- pool_descriptor()¶
How a worker rebuilds this content’s
Pool, orNonewhen it can’t be rebuilt in another process.
- class synology_apm_repo.sdk.dedup.pool_descriptor.WorkerContext(store=None, pool=None)¶
Bases:
objectOne worker process’s
ObjectStore/Poolpair, kept warm across its tasks: built once byinit(), released once byshutdown(). Used bydedup.verify_bucket_checkanddedup.export_workers.Each entry point keeps its own top-level
_*_worker_init/_*_worker_shutdownpair (spawnpickles the initializer) that delegates the store/pool half here and adds any extra per-worker state.Not
frozen:init()assigns in place.- store: ObjectStore | None = None¶
- init(descriptor)¶
- shutdown()¶
- class synology_apm_repo.sdk.dedup.pool_descriptor.BoundProcessPool(pool_descriptor, *, initializer, initargs, max_workers=None)¶
Bases:
AsyncClosingWorker processes bound for their lifetime to one repository (
pool_descriptor): their initializer builds that repository’sPoolonce, and nothing re-initializes them per task. Async context manager;close()shuts them down.- Variables:
pool_descriptor – The repository the workers serve.
max_workers – How many worker processes there are, which is also how many tasks to keep in flight.
process_pool – The underlying executor, for
concurrency.dispatch_to_pool.
- accepts_pool(pool_descriptor)¶
Whether work on
pool_descriptor’s repository may run here.
- async close()¶
Shuts the workers down, waiting for in-flight tasks (off the event loop).