Table of Contents

Class DownloadParams

Namespace
DatabentoDotNet.Historical
Assembly
DatabentoDotNet.Historical.dll
public sealed record DownloadParams : IEquatable<DownloadParams>
Inheritance
DownloadParams
Implements
Inherited Members

Remarks

Port of upstream's DownloadParams (batch.rs:620-630), plus MaximumConcurrency, which upstream has no equivalent of because its download transfers files one at a time.

Downloading costs nothing. A batch job is billed when it is submitted, and its files stay fetchable until ExpirationTimestamp — upstream marks submit_job with a cost warning and marks download with none, and #39 confirmed the asymmetry against the live API. So a download can be retried, resumed, or run again from scratch without a second charge.

Fields

DefaultMaximumConcurrency

How many files transfer at once unless MaximumConcurrency says otherwise.

public const int DefaultMaximumConcurrency = 4

Field Value

int

Properties

Filename

One file to download by name, or null for every file the job produced.

public string? Filename { get; init; }

Property Value

string

Remarks

The name must be one ListFilesAsync(string, CancellationToken) reports for this job — DownloadAsync(DownloadParams, CancellationToken) looks it up rather than constructing a URL from it, so a name that is not in the job is an error and not a 404 much later. Remember that a job's files include the three Databento packages with every job: manifest.json, metadata.json and condition.json.

JobId

The job to download, by Id.

public required string JobId { get; init; }

Property Value

string

MaximumConcurrency

How many files to transfer at once. Defaults to DefaultMaximumConcurrency.

public int MaximumConcurrency { get; init; }

Property Value

int

Remarks

Parallel transfer is a departure from upstream, whose download loops over the file list one file at a time (batch.rs:227-243). ROADMAP.md §5 asks for it, and a batch job routinely splits into hundreds of files — a day-split year of data is 250-odd — where sequential transfer spends most of its time waiting rather than reading.

The per-file logic is unchanged by it. Each file still resumes, skips or fails on its own exactly as upstream's does; only how many are in flight differs. That is what keeps the departure reviewable — see DownloadAsync(DownloadParams, CancellationToken).

The default is deliberately small. Every file of a job comes from one host, so the useful range is "more than one" rather than "as many as there are files", and a large bound turns a job with hundreds of files into hundreds of simultaneous connections to Databento. Set it to 1 for upstream's exact behaviour.

Exceptions

ArgumentOutOfRangeException

The value is less than one.

OutputDirectory

The directory to write into. The job's own directory is created inside it.

public required string OutputDirectory { get; init; }

Property Value

string

Remarks

Files land in {OutputDirectory}/{JobId}/{filename}, as upstream does (batch.rs:196). The job directory is created if it is absent; an existing file at that path is an error rather than something to overwrite.