Skip to content

findMatchingDataSets

findMatchingDataSets(dataSets, metadata): SelectionDataSet[]

Defined in: packages/synapse-core/src/warm-storage/find-matching-data-sets.ts:51

Find datasets matching the given metadata, sorted by preference.

Matching is exact: a dataset matches only if its metadata keys and values are identical to the requested metadata.

Only active datasets are considered (live, managed, pdpEndEpoch === 0n).

Sort order:

  1. Datasets with pieces (activePieceCount > 0) before empty datasets
  2. Within each group, older datasets (lower ID) first
ParameterTypeDescription
dataSetsSelectionDataSet[]Datasets to search (typically filtered to a single provider)
metadataMetadataObjectDesired metadata keys and values

SelectionDataSet[]

Matching datasets in preference order