fleche.storage.bagofholding_file
Attributes
Classes
File-based storage backend using pickle. |
|
Mixin that locks per-key so concurrent ops on different keys proceed in parallel. |
|
Mixin that locks per-key so concurrent ops on different keys proceed in parallel. |
Module Contents
- class fleche.storage.bagofholding_file.BagOfHoldingH5FileBackend[source]
Bases:
fleche.storage.file.FileStorageFile-based storage backend using pickle.
Stores objects on the filesystem.
- version_validator: VersionValidator | None = None[source]
- rebag(version_validator: VersionValidator = 'none') None[source]
Re-open and re-save all bags using the given version validator.
Useful when bags were created with an older library version and would otherwise fail strict version checking on load.
- class fleche.storage.bagofholding_file.ValueBagOfHoldingH5File[source]
Bases:
fleche.storage.thread_safe.PerKeyLockMixin,fleche.storage.destructuring.DestructuringMixin,fleche.storage.base.ValueMixin,BagOfHoldingH5FileBackendMixin that locks per-key so concurrent ops on different keys proceed in parallel.
A lightweight
threading.Lockguards the lock-table itself; once the per-keyRLockis obtained the table lock is released, so two threads operating on different keys never block each other. Operations on the same key are serialized by the per-key lock, which is reentrant to allow nested calls (e.g.expandinsideload).Instances must be hashable. Place before the concrete storage class in the MRO:
@dataclass(frozen=True) class PerKeyValuePickle(PerKeyLockMixin, ValuePickleFile): ...
- class fleche.storage.bagofholding_file.CallBagOfHoldingH5File[source]
Bases:
fleche.storage.thread_safe.PerKeyLockMixin,fleche.storage.base.CallMixin,BagOfHoldingH5FileBackendMixin that locks per-key so concurrent ops on different keys proceed in parallel.
A lightweight
threading.Lockguards the lock-table itself; once the per-keyRLockis obtained the table lock is released, so two threads operating on different keys never block each other. Operations on the same key are serialized by the per-key lock, which is reentrant to allow nested calls (e.g.expandinsideload).Instances must be hashable. Place before the concrete storage class in the MRO:
@dataclass(frozen=True) class PerKeyValuePickle(PerKeyLockMixin, ValuePickleFile): ...