swh.objstorage.backends.generator module#
- swh.objstorage.backends.generator.gen_sizes()[source]#
generates numbers according to the rought distribution of file size in the SWH archive
- swh.objstorage.backends.generator.gen_random_content(total=None, filesize=None)[source]#
generates random (file) content which sizes roughly follows the SWH archive file size distribution (by default).
- class swh.objstorage.backends.generator.RandomGeneratorObjStorage(filesize=None, total=None, **kwargs)[source]#
Bases:
ObjStorage
A stupid read-only storage that generates blobs for testing purpose.
- name: str = 'generator'#
Default objstorage name; can be overloaded at instantiation time giving a ‘name’ argument to the constructor
- property content_generator#
- check(obj_id, *args, **kwargs)[source]#
Check if a content is found and recompute its hash to check integrity.
- list_content(last_obj_id: bytes | CompositeObjId | None = None, limit: int | None = 10000) Iterator[CompositeObjId] [source]#