Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-archiver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Platform
Development
swh-archiver
Commits
115cbdcb
Commit
115cbdcb
authored
8 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
archiver: Complete docstring's information
parent
61b6796a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/archiver/worker.py
+27
-0
27 additions, 0 deletions
swh/archiver/worker.py
with
27 additions
and
0 deletions
swh/archiver/worker.py
+
27
−
0
View file @
115cbdcb
...
...
@@ -228,6 +228,12 @@ class BaseArchiveWorker(config.SWHConfig, metaclass=abc.ABCMeta):
among the missing copies and a source server among the
presents.
Args:
present: set of objstorage source name where the content
is present
missing: set of objstorage destination name where the
content is missing
Yields:
tuple (source (str), destination (src)) for each required copy.
...
...
@@ -299,6 +305,12 @@ class ArchiverWithRetentionPolicyWorker(BaseArchiveWorker):
retention policy requirement will be fulfilled. However, the
source server may be used multiple times.
Args:
present: set of objstorage source name where the content
is present
missing: set of objstorage destination name where the
content is missing
Yields:
tuple (source, destination) for each required copy.
...
...
@@ -347,4 +359,19 @@ class ArchiverToBackendWorker(BaseArchiveWorker):
return
self
.
destination
in
content_data
.
get
(
'
missing
'
,
{})
def
choose_backup_servers
(
self
,
present
,
missing
):
"""
The destination is fixed to the destination mentioned.
The only variable here is the source of information that we
choose randomly in
'
present
'
.
Args:
present: set of objstorage source name where the content
is present
missing: set of objstorage destination name where the
content is missing
Yields:
tuple (source, destination) for each required copy.
"""
yield
(
random
.
choice
(
list
(
present
)),
self
.
destination
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment