swh.alter.operations module#
- class swh.alter.operations.Removable(removable_swhids: List[ExtendedSWHID], referencing: List[ExtendedSWHID])[source]#
Bases:
NamedTuple
Aggregates information returned by
Remover.get_removable()
to be then used withRemover.create_recovery_bundle()
.Create new instance of Removable(removable_swhids, referencing)
- removable_swhids: List[ExtendedSWHID]#
Alias for field number 0
- referencing: List[ExtendedSWHID]#
Alias for field number 1
- class swh.alter.operations.Remover(storage: StorageInterface, graph_client: RemoteGraphClient, known_missing: Set[ExtendedSWHID] | None = None, 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, progressbar: ProgressBarInit | 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) Removable [source]#
- create_recovery_bundle(secret_sharing: SecretSharing, requested: List[Origin | ExtendedSWHID], removable: Removable, recovery_bundle_path: str, removal_identifier: str, reason: str | None = None, expire: datetime | None = None, allow_empty_content_objects: bool = False) str [source]#
- remove_from_storage(name: str, removal_storage: ObjectDeletionInterface) None [source]#
- remove_from_journal(name: str, journal_writer: KafkaJournalWriter) None [source]#
- remove_from_search(name: str, search: SearchInterface) None [source]#
- remove_from_objstorage(name: str, objstorage: ObjStorageInterface) Set[FrozenSet[Tuple[str, str]]] [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.