swh.objstorage.backends.winery.pools package#
Submodules:
Module contents:
- class swh.objstorage.backends.winery.pools.ImageReader(*args, **kwargs)[source]#
Bases:
ProtocolProtocol for images’ reader classes. This allows a pool to pick a class depending on the backing file format (currently swh.shard.Shard or swh.mosaic.MosaicReader)
- class swh.objstorage.backends.winery.pools.ImageWriter(*args, **kwargs)[source]#
Bases:
ProtocolProtocol for images’ writer classes. This allows a pool to pick a class depending on the backing file format (currently swh.shard.ShardCreator or swh.mosaic.MosaicWriter).
- class swh.objstorage.backends.winery.pools.Pool(*args, **kwargs)[source]#
Bases:
Protocol- image_exists(image: str) bool[source]#
Check whether the named image exists (it does not have to be mapped)
- image_mapped(image: str) Literal['ro', 'rw'] | None[source]#
Check whether the image is already mapped, read-only or read-write
- image_create(image: str) None[source]#
Create a new image named image and allocate the right amount of space.
- image_map(image: str, options: str) None[source]#
Map an image for use. Options can be “ro” to map the image read-only, or “rw” to map the image read-write.
- image_unmap(image: str) None[source]#
Unmap the image. Once this is done, the image is unavailable for use.
- image_open(image: str) ImageReader[source]#
- class swh.objstorage.backends.winery.pools.FileBackedPool(base_directory: Path, pool_name: str, shard_max_size: int)[source]#
Bases:
PoolFile-backed pool for Winery shards mimicking a Ceph RBD pool.
Unmapped images are represented by setting the file permission to 0o000.
- image_exists(image: str) bool[source]#
Check whether the named image exists (it does not have to be mapped)
- image_create(image: str) None[source]#
Create a new image named image and allocate the right amount of space.
- image_map(image: str, options: str) None[source]#
Map an image for use. Options can be “ro” to map the image read-only, or “rw” to map the image read-write.
- swh.objstorage.backends.winery.pools.pool_from_settings(shards_settings: Shards, shards_pool_settings: ShardsPool) Pool[source]#
Return a Pool from the settings