R/shift-download-reanalysis.R
shift_download_reanalysis.RdExecute an independent shift_plan_reanalysis() plan serially, retaining a
submission ledger and raw assets. This transport stage does not validate
weather; use shift_read_reanalysis() after acquiring all required files.
shift_download_reanalysis(
plan,
dir,
limits = list(),
resume = TRUE,
poll_interval = 1
)An unchanged shift_plan_reanalysis() result.
Directory dedicated to this plan and provider origin.
Named list: max_submissions, max_file_bytes and
max_total_bytes default to Inf; wait_timeout defaults to 3600 seconds,
download_timeout to 600 seconds, and total_timeout to Inf.
Reuse the ledger and verified completed assets. FALSE refuses
an existing ledger rather than deleting it or submitting duplicate jobs.
Positive seconds between status requests; default 1.
A list with transport status, named completed files, request
receipts, this invocation's execution measurements, cumulative counters,
accounting_uncertain flag, and receipt path.
downloaded means HTTP assets are complete, not validated weather.
Credentials use the existing CDS environment/configuration settings. Tokens
and signed asset URLs are never saved. A job ID is durably recorded before
polling. An uncertain submission is ambiguous and never automatically
posted again. A directory lock prevents concurrent writers; an orphaned
lock requires verifying its recorded owner has stopped before removal.
Submission counts and total byte budgets accumulate across invocations in
this directory, including failed attempts and JSON response
bodies. Response-body bytes delivered to the stream reader and bytes written
to assets are counted separately. The first block crossing a limit aborts
the request without being written. Bytes already buffered by the network
cannot be recalled: these are fail-stop thresholds, not an exact wire-byte
ceiling. HTTP/TLS headers and uploads are outside response-body accounting.
A killed process may leave only a lower bound for its last in-flight attempt;
resuming records that uncertainty and stops rather than declaring zero lost
traffic. Resume inherits earlier limits; raising them requires explicit
limits values. Timeouts apply per invocation or per individual wait/download.
The file-byte threshold applies to each individual asset response. A fixed
1 MiB response threshold also bounds each JSON control message. Redirects
are rejected; tokens are sent only to the configured API base path.
Partial files are never returned as complete. Downloads restart from the original job's refreshed result URL; they do not resume a byte range. Asset responses must have HTTP status 200. Completed files are returned only after size and SHA-256 verification during the current invocation.