PolyGenius
Contents

ResourceSpec

Resource Specification

Lightweight resource descriptors used by the reactive execution framework. Resource identity is defined by type + params. Runtime capabilities and constraints are stored in meta and do not affect identity.

Specs may be partial requests when some identity fields are not known before execution, for example a remote GWAS build or an internally expanded algorithm candidate. A producing rule can return a more complete spec in its result. The scheduler then saves only the resolved spec and records the requested-id to resolved-id mapping in execution state so downstream tasks and callers use the materialized identity.

Details

Resource specification

Public fields

type — Character. Resource type.

params — Named list. Identity parameters.

meta — Named list. Capabilities and runtime metadata.

param.match — Named list. Per-parameter matching strategies for ResourceStore$find(). Keys are parameter names; values are one of "exact" (hash equality, the default for all params), "numeric.gte" (a cached resource whose stored value is >= the requested value satisfies the request -- use for thresholds like pval.max where a more permissive cached value is a superset of a stricter request), or "numeric.lte". Parameters absent from this list use "exact". Does not contribute to the identity hash.

serializer — Character. Serializer key from resources.serializer; resolve to handlers with resource.serializer.resolve(). Deliberately NOT the handler list -- that dragged the whole serializer registry (153 KB) into every spec and onto every worker dispatch.

id — Character. Resource identifier (hash of type + params).

Methods

Public methods

  • ResourceSpec$new()
  • ResourceSpec$print()
  • ResourceSpec$clone()

Method new()

Create a ResourceSpec

Usage

ResourceSpec$new(
  type,
  ...,
  .meta = NULL,
  .param.match = list(),
  .serializer = resources.serializer$rds
)

Arguments

type — Character; resource type

... — Named identity parameters. All build strings must be pre-normalised via genomeBuilds$key() before construction -- the class does not normalise and will compute the identity hash over whatever string is given.

.meta — Named list of runtime metadata/capabilities. Non-scalar values are accepted here but will not be stored in the resource index (see ResourceStore). Store complex values in the resource data payload.

.param.match — Named list mapping parameter names to matching strategies used by ResourceStore$find(). Valid strategies: "exact" (hash equality, default), "numeric.gte" (cached >= requested), "numeric.lte" (cached <= requested). Parameters not listed use "exact". Does not affect the identity hash.

.serializer — Character serializer key from resources.serializer.

Method print()

Print resource overview

Usage

ResourceSpec$print(...)

Arguments

... — Unused

Returns

Invisible self

Method clone()

The objects of this class are cloneable with this method.

Usage

ResourceSpec$clone(deep = FALSE)

Arguments

deep — Whether to make a deep clone.

See Also