Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1122
generate backfill command for a given range (for sha1)
Active
Public
Actions
Authored by
vsellier
on Aug 17 2021, 12:34 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
import
sys
begin
=
0
end
=
0x1000000
#partitions=10
partitions
=
int
(
sys
.
argv
[
1
])
current
=
int
(
sys
.
argv
[
2
])
inc
=
int
(
end
/
partitions
)
#print(f"current: {current}")
#print(f"end: {end}")
#print(f"inc: {inc}")
start_object
=
begin
+
int
(
current
)
*
int
(
inc
)
end_object
=
start_object
+
int
(
inc
)
#print(start_object)
if
current
>
0
:
start_object
+=
1
if
start_object
>=
end
:
sys
.
exit
(
0
)
#print(start_object)
start_object_str
=
format
(
start_object
,
"06x"
)
end_object_str
=
format
(
end_object
,
"06x"
)
if
end_object
<
end
-
1
:
print
(
f
"swh --log-config /etc/softwareheritage/journal/backfill_logger.yml storage backfill extid --start-object {start_object_str} --end-object {end_object_str}"
)
else
:
print
(
f
"swh --log-config /etc/softwareheritage/journal/backfill_logger.yml storage backfill extid --start-object {start_object_str}"
)
Event Timeline
vsellier
created this paste.
Aug 17 2021, 12:34 PM
2021-08-17 12:34:05 (UTC+2)
vsellier
mentioned this in
P1121 bakfill script for sha1 based ranges
.
vsellier
edited the content of this paste.
(Show Details)
Aug 17 2021, 12:52 PM
2021-08-17 12:52:14 (UTC+2)
vsellier
mentioned this in
T3485: extid topic is misconfigured in staging and production
.
Aug 17 2021, 1:33 PM
2021-08-17 13:33:10 (UTC+2)
vsellier
edited the content of this paste.
(Show Details)
Aug 17 2021, 3:03 PM
2021-08-17 15:03:10 (UTC+2)
Log In to Comment