swh.storage package#
Subpackages#
Submodules#
- swh.storage.backfill module
- swh.storage.cli module
- swh.storage.common module
- swh.storage.exc module
- swh.storage.fixer module
- swh.storage.in_memory module
- swh.storage.interface module
ListOrderPartialBranchesSnapshotBranchByNameResponseHashDictTotalHashDictOriginVisitWithStatusesObjectReferencedeprecated()StorageInterfaceStorageInterface.check_config()StorageInterface.content_add()StorageInterface.content_update()StorageInterface.content_add_metadata()StorageInterface.content_get_data()StorageInterface.content_get_partition()StorageInterface.content_get()StorageInterface.content_missing()StorageInterface.content_missing_per_sha1()StorageInterface.content_missing_per_sha1_git()StorageInterface.content_find()StorageInterface.content_get_random()StorageInterface.skipped_content_add()StorageInterface.skipped_content_find()StorageInterface.skipped_content_missing()StorageInterface.directory_add()StorageInterface.directory_missing()StorageInterface.directory_ls()StorageInterface.directory_entry_get_by_path()StorageInterface.directory_get_entries()StorageInterface.directory_get_raw_manifest()StorageInterface.directory_get_random()StorageInterface.directory_get_id_partition()StorageInterface.revision_add()StorageInterface.revision_missing()StorageInterface.revision_get_partition()StorageInterface.revision_get()StorageInterface.revision_log()StorageInterface.revision_shortlog()StorageInterface.revision_get_random()StorageInterface.extid_get_from_extid()StorageInterface.extid_get_from_target()StorageInterface.extid_add()StorageInterface.release_add()StorageInterface.release_missing()StorageInterface.release_get()StorageInterface.release_get_random()StorageInterface.release_get_partition()StorageInterface.snapshot_add()StorageInterface.snapshot_missing()StorageInterface.snapshot_get()StorageInterface.snapshot_count_branches()StorageInterface.snapshot_get_branches()StorageInterface.snapshot_get_random()StorageInterface.snapshot_branch_get_by_name()StorageInterface.snapshot_get_id_partition()StorageInterface.origin_visit_add()StorageInterface.origin_visit_status_add()StorageInterface.origin_visit_get()StorageInterface.origin_visit_find_by_date()StorageInterface.origin_visit_get_by()StorageInterface.origin_visit_get_latest()StorageInterface.origin_visit_status_get()StorageInterface.origin_visit_status_get_latest()StorageInterface.origin_visit_get_with_statuses()StorageInterface.origin_visit_status_get_random()StorageInterface.origin_get()StorageInterface.origin_get_by_sha1()StorageInterface.origin_list()StorageInterface.origin_search()StorageInterface.origin_count()StorageInterface.origin_snapshot_get_all()StorageInterface.origin_add()StorageInterface.object_find_recent_references()StorageInterface.object_references_add()StorageInterface.object_find_by_sha1_git()StorageInterface.stat_counters()StorageInterface.refresh_stat_counters()StorageInterface.raw_extrinsic_metadata_add()StorageInterface.raw_extrinsic_metadata_get()StorageInterface.raw_extrinsic_metadata_get_by_ids()StorageInterface.raw_extrinsic_metadata_get_authorities()StorageInterface.metadata_fetcher_add()StorageInterface.metadata_fetcher_get()StorageInterface.metadata_authority_add()StorageInterface.metadata_authority_get()StorageInterface.clear_buffers()StorageInterface.flush()
ObjectDeletionInterfaceObjectReferencesPartitionPartitionsManagementInterface
- swh.storage.metrics module
- swh.storage.migrate_extrinsic_metadata module
pypi_project_from_filename()pypi_origin_from_project_name()pypi_origin_from_filename()cran_package_from_url()npm_package_from_source_url()remove_atom_codemeta_metadata_with_xmlns()remove_atom_codemeta_metadata_without_xmlns()debian_origins_from_row()assert_origin_exists()check_origin_exists()load_metadata()handle_deposit_row()handle_row()create_fetchers()iter_revision_rows()main()
- swh.storage.objstorage module
- swh.storage.pytest_plugin module
- swh.storage.replay module
- swh.storage.utils module
- swh.storage.writer module
model_object_dict_sanitizer()JournalWriterJournalWriter.write_addition()JournalWriter.write_additions()JournalWriter.content_add()JournalWriter.content_update()JournalWriter.content_add_metadata()JournalWriter.skipped_content_add()JournalWriter.directory_add()JournalWriter.revision_add()JournalWriter.release_add()JournalWriter.snapshot_add()JournalWriter.origin_visit_add()JournalWriter.origin_visit_status_add()JournalWriter.origin_add()JournalWriter.raw_extrinsic_metadata_add()JournalWriter.metadata_fetcher_add()JournalWriter.metadata_authority_add()JournalWriter.extid_add()
Module contents#
- swh.storage.get_storage(cls: str, **kwargs) StorageInterface[source]#
Get a storage object of class
clswith arguments**kwargs.clsmust be one of theswh.storage.classesentry-points- Parameters:
cls (str) –
- storage’s class, can be:
localto use a postgresql databasecassandrato use a cassandra databaseremoteto connect to a swh-storage servermemoryfor an in-memory storage, useful for fast testsfilter,buffer, … to use specific storage “proxies”, see their respective documentations
args (dict) – dictionary with keys
- Returns:
an instance of swh.storage.Storage or compatible class
- Raises:
ValueError if passed an unknown storage class. –
- swh.storage.get_storage_pipeline(steps: List[Dict[str, Any]], check_config=None) StorageInterface[source]#
Recursively get a storage object that may use other storage objects as backends.
- Parameters:
steps (List[dict]) – List of dicts that may be used as kwargs for get_storage.
- Returns:
an instance of swh.storage.Storage or compatible class
- Raises:
ValueError if passed an unknown storage class. –