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:
- Datasets with pieces (activePieceCount > 0) before empty datasets
- Within each group, older datasets (lower ID) first
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
dataSets | SelectionDataSet[] | Datasets to search (typically filtered to a single provider) |
metadata | MetadataObject | Desired metadata keys and values |
Returns
Section titled “Returns”Matching datasets in preference order