swh.alter.inventory module#
This module implements the inventory stage of the removal algorithm.
- class swh.alter.inventory.InventorySubgraph(*args, **kwargs)[source]#
Bases:
Subgraph
A subgraph holding an inventory of all candidates for removal
When all references from a given node have been accounted for, the
complete
attribute is set to True.See
Subgraph
- swh.alter.inventory.make_inventory(storage, graph_client, swhids: Collection[ExtendedSWHID]) InventorySubgraph [source]#
Inventory candidates for removal from the given set of SWHID.
By querying the given storage and graph_client, create a subgraph with all objects belonging to the given set of SWHIDs (typically origins). The result should then used to verify which candidate can safely be removed.