This module implements the marking stage of the removal algorithm.
- class swh.alter.removable.RemovableSubgraph(*args, **kwargs)#
A class representing the subgraph of objects that can be safely removed from the archive
This subgraph should only be created from an
from_inventory_subgraph(). No new vertices or edges can be added at this point.
Getting the list of SWHID that can be removed is done by using py:meth:removable_swhids.
After marking happened, this subgraph will contain all candidates until
Delete all vertices for unremovable objects from this subgraph.
- swh.alter.removable.mark_removable(storage: StorageInterface, graph_client: RemoteGraphClient, inventory_subgraph: InventorySubgraph) RemovableSubgraph #
Find which candidates can be safely removed from the archive.
Using the previously populated
inventory_subgraph, query the given
graph_clientto assess inbound references for each candidate and see which one can be safely removed from the archive.