Skip to contents

A release that lands must catalog what it published: a pointer at an object the catalog lacks fails store_publish_gate() and leaves the object invisible to verify_asset_store.R and the garbage collector. Finds the keys of urls missing from catalog (asset_catalog_missing()), asks fetch for a local copy of each (bytes and md5 come from the file), builds their rows with asset_catalog_rows() and appends them with asset_catalog_add(). A second call finds nothing missing and returns catalog unchanged.

Usage

asset_catalog_register(catalog, urls, payload_hash, enc, first_ver, fetch)

Arguments

catalog

the current catalog

urls

pointer URLs of the release

payload_hash

payload hash of each URL's object (NA when unknown), length of urls

enc

encoding tag of each URL's object (NA when unknown), length of urls

first_ver

the release registering the objects

fetch

function(keys) returning one local file path per key

Value

the catalog with the new rows; the keys added are in attr(, "added")

Details

payload_hash / enc are what the key was made from. asset_catalog_check() verifies that content_hash_encoded(payload_hash, enc) is the key's hash, so a wrong encoding tag stops here; give NA for both when the payload is unknown (the legacy convention of the existing usa05 rows).