Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/objstorage.py
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | def get_batch(self, obj_ids, *args, **kwargs): | ||||
yield self.get(obj_id) | yield self.get(obj_id) | ||||
except ObjNotFoundError: | except ObjNotFoundError: | ||||
yield None | yield None | ||||
@abc.abstractmethod | @abc.abstractmethod | ||||
def check(self, obj_id, *args, **kwargs): | def check(self, obj_id, *args, **kwargs): | ||||
"""Perform an integrity check for a given object. | """Perform an integrity check for a given object. | ||||
Verify that the file object is in place and that the gzipped content | Verify that the file object is in place and that the content matches | ||||
matches the object id. | the object id. | ||||
Args: | Args: | ||||
obj_id (bytes): object identifier. | obj_id (bytes): object identifier. | ||||
Raises: | Raises: | ||||
ObjNotFoundError: if the requested object is missing. | ObjNotFoundError: if the requested object is missing. | ||||
Error: if the request object is corrupted. | Error: if the request object is corrupted. | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |