swh.objstorage.factory module#
- swh.objstorage.factory.get_objstorage(cls: str, **kwargs) ObjStorageInterface [source]#
Create an ObjStorage using the given implementation class.
- Parameters:
cls – objstorage class unique key contained in the _STORAGE_CLASSES dict.
kwargs – arguments for the required class of objstorage that must match exactly the one in the __init__ method of the class.
- Returns:
subclass of ObjStorage that match the given storage_class argument.
- Raises:
ValueError – if the given storage class is not a valid objstorage key.
- class swh.objstorage.factory.ObjStorage(*, allow_delete=False, **kwargs)[source]#
Bases:
object
- add_batch(contents: Mapping[bytes, bytes] | Iterable[Tuple[bytes | CompositeObjId, bytes]], check_presence: bool = True) Dict [source]#
- abstract delete(obj_id: bytes | CompositeObjId)[source]#
- list_content(last_obj_id: bytes | CompositeObjId | None = None, limit: int | None = 10000) Iterator[CompositeObjId] [source]#