swh.alter.operations module#

exception swh.alter.operations.RemoverError[source]#

Bases: Exception

class swh.alter.operations.Remover(storage: StorageInterface, graph_client: RemoteGraphClient, restoration_storage: StorageInterface | None = None, removal_searches: Dict[str, SearchInterface] | None = None, removal_storages: Dict[str, ObjectDeletionInterface] | None = None, removal_objstorages: Dict[str, ObjStorageInterface] | None = None, removal_journals: Dict[str, KafkaJournalWriter] | None = None)[source]#

Bases: object

Helper class used to perform a removal.

get_removable(swhids: List[ExtendedSWHID], *, output_inventory_subgraph: TextIO | None = None, output_removable_subgraph: TextIO | None = None, output_pruned_removable_subgraph: TextIO | None = None) List[ExtendedSWHID][source]#
register_object(obj: HasSwhid | HasUniqueKey) None[source]#
create_recovery_bundle(secret_sharing: SecretSharing, removable_swhids: List[ExtendedSWHID], recovery_bundle_path: str, removal_identifier: str, reason: str | None = None, expire: datetime | None = None) None[source]#
restore_recovery_bundle() None[source]#
remove() None[source]#
remove_from_objstorage(name: str, objstorage: ObjStorageInterface) None[source]#
have_new_references(removed_swhids: List[ExtendedSWHID]) bool[source]#

Find out if any removed objects now have a new references coming from an object outside the set of removed objects.