Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/luigi/origin_contributors.py
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | def run(self) -> None: | ||||
class_name = "org.softwareheritage.graph.utils.ListOriginContributors" | class_name = "org.softwareheritage.graph.utils.ListOriginContributors" | ||||
with tempfile.NamedTemporaryFile( | with tempfile.NamedTemporaryFile( | ||||
prefix="origin_urls_", suffix=".csv" | prefix="origin_urls_", suffix=".csv" | ||||
) as origin_urls_fd: | ) as origin_urls_fd: | ||||
script = f""" | script = f""" | ||||
zstdcat {self.topological_order_path} \ | zstdcat {self.topological_order_path} \ | ||||
| java {class_name} '{self.local_graph_path}/{self.graph_name}' '{origin_urls_fd.name}' \ | | java {class_name} '{self.local_graph_path}/{self.graph_name}' '{origin_urls_fd.name}' \ | ||||
| pv --line-mode --wait \ | | pv --line-mode --wait --size $(zstdcat '{self.topological_order_path}' | wc -l) \ | ||||
| zstdmt -19 | | zstdmt -19 | ||||
""" # noqa | """ # noqa | ||||
run_script(script, self.origin_contributors_path) | run_script(script, self.origin_contributors_path) | ||||
run_script( | run_script( | ||||
f"pv '{origin_urls_fd.name}' | zstdmt -19", | f"pv '{origin_urls_fd.name}' | zstdmt -19", | ||||
self.origin_urls_path, | self.origin_urls_path, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |