- class swh.objstorage.multiplexer.filter.read_write_filter.ReadObjStorageFilter(storage)
Filter that disable write operation of the storage.
Writes will always succeed without doing any actual write operations.
- check_config(*, check_write)
Check the object storage for proper configuration.
check_write – check whether writes to the objstorage will succeed
True if the storage is properly configured
- add(*args, **kwargs)
Add a new object to the object storage.
content (bytes) – object’s raw content to add in storage.
obj_id (bytes) – checksum of [bytes] using [ID_HASH_ALGO] algorithm. When given, obj_id will be trusted to match the bytes. If missing, obj_id will be computed on the fly.
check_presence (bool) – indicate if the presence of the content should be verified before adding the file.
the id (bytes) of the object into the storage.
- restore(*args, **kwargs)
Restore a content that have been corrupted.
This function is identical to add but does not check if the object id is already in the file system. The default implementation provided by the current class is suitable for most cases.