pub struct ParsedOp {Show 19 fields
pub name: String,
pub description: Option<String>,
pub op: HashMap<String, Value>,
pub bindings: BindingsDef,
pub params: HashMap<String, Value>,
pub tags: HashMap<String, String>,
pub condition: Option<String>,
pub delay: Option<DelaySpec>,
pub metrics: HashMap<String, MetricSpec>,
pub result: Option<ResultSpec>,
pub traverse: Option<TraverseSpec>,
pub wrappers: Option<WrappersConfig>,
pub captures: Vec<CapturePoint>,
pub abstract_interface: Option<OpInterface>,
pub interface_bound: bool,
pub daemon: DaemonSpec,
pub daemon_cancel_grace_ms: Option<u64>,
pub while_cond: Option<String>,
pub rate: Option<String>,
}Expand description
A normalized op template — the canonical form.
Fields§
§name: String§description: Option<String>§op: HashMap<String, Value>The operation payload: field name → value.
The statement is always under "stmt" after normalization.
The original field name that carried the statement (e.g., "raw",
"simple", "prepared", "stmt") is preserved in stmt_type
for adapters that dispatch on execution mode.
bindings: BindingsDefBinding definitions: either a name→expression map (legacy) or a Polydat grammar source string (native).
params: HashMap<String, Value>Configuration parameters.
Tags for filtering and metadata.
condition: Option<String>Optional condition expression (from YAML if: field).
Evaluated per cycle before the op executes. If the result
is falsy (false, 0, empty string, None), the op is skipped.
delay: Option<DelaySpec>Optional delay specification (from YAML delay: field).
Two surface forms:
- Bare string:
delay: <name>— a Polydat binding name producing the pre-op delay value (u64 = ns, f64 = ms). - Map:
delay: { before: <name>, after: <name> }— independent pre-op and post-op delays; both subkeys are optional but at least one must be set.
metrics: HashMap<String, MetricSpec>SRD-40b synthetic-metric declarations. Each entry
publishes one metric family per cycle, valued by a GK
expression evaluated in the op’s bound scope. Empty
when absent. Map key is the metric name and the
default family name; MetricSpec::family overrides
it when set. See SRD-40b §1 for the schema, §2 for
sugared forms (bare-string / list with wire-expression
entries).
result: Option<ResultSpec>SRD-66 result-bindings. Vari-structured: string is
Polydat source, list is a sequence of fragments, map is
named-key short-forms with a composite-map output.
None ⇒ no result wires; the result wrapper is a
no-op for this op.
traverse: Option<TraverseSpec>Optional traverse: block — CUSTOMISES the always-installed result
traversal layer; it does not select it. Like result:, absence means
“default behaviour”, not “no traversal”.
wrappers: Option<WrappersConfig>SRD-32a Push 3 — per-op wrapper-composition override.
When present, this op uses the named order instead of
the workload-root or runtime-default tiebreaker order.
Shadows the workload-root wrappers: block entirely
(no merge).
captures: Vec<CapturePoint>Capture-point specs extracted at parse time from any
string-valued entry in op. Each spec names a column the
result body carries and the wire it should be written to
via ctx.wires.write at cycle time. The slurp flag
selects between single-row ([name]) and all-rows
([@name]) extraction.
The parser strips the bracket syntax from the source op
fields after harvesting the spec, so adapters consume
clean text (e.g. SELECT [key] FROM ... becomes
SELECT key FROM ...). Downstream wrappers read this
list directly — no re-parsing of the op’s text fields.
abstract_interface: Option<OpInterface>SRD-108 Part B — present when this op was declared as an
ABSTRACT slot (abstract: body): the interface a bound
implementation must satisfy. Retained on the bound op so
pre-map synthesis can verify yields against the compiled
op-template program.
interface_bound: boolSRD-108 Part B — true once an implementation has been
bound into this slot. An op with an interface but
interface_bound == false at run initiation is a load
error (“abstract op unbound”).
daemon: DaemonSpecDaemon-fiber declaration. When set to a non-Disabled
value, dispatches of this op from the cycle-pool spawn
onto a daemon fiber instead of running inline. Daemons
stay in scope of the phase so their failures bubble up;
the cycle-pool fiber continues immediately to the next
op without awaiting.
YAML forms accepted:
daemon: false/daemon: 0/daemon: "off"→ not a daemon (cycle-pool op).daemon: true/daemon: 1/daemon: "on"→ daemon, max 1 concurrent fiber per phase activation.daemon: <N>(N ≥ 1) → daemon, max N concurrent fibers per phase activation.
The cap is enforced at spawn time: when the cycle-pool dispatches the op and the live-fiber count is already at N, the spawn errors and the phase fails with a clear stop_reason. There’s no queuing — exceeding the cap is a workload-design error, not backpressure to absorb.
Per-op-name dedup: daemons are tracked by op-template name. Subsequent dispatches of the same name silently succeed up to the cap; over the cap they fail loud. Natural daemon exit (Completed / Cancelled / Errored / TimedOut / Panicked) decrements the count, freeing a slot for the next dispatch.
Use case: a long-running server call (e.g.
forceKeyspaceCompaction) that the workload wants to
fire while a sibling op concurrently observes progress.
The daemon op stays in scope so its failures bubble up;
the cycle-pool op runs alongside without serialisation.
Parser invariants when daemon is MaxFibers(_):
cycles:andratio:on this op are rejected — the daemon’s dispatch cadence is governed by the cycle-pool walks, not by cycles-per-second.if:/while:apply as usual; a falsy guard skips the dispatch with no spawn.
daemon_cancel_grace_ms: Option<u64>How long the phase waits for this daemon’s in-flight future to drop after sending the stop signal. Past the window, the phase records a daemon-shutdown failure and fails. Per-op override of the activity-level default (5000 ms).
Only meaningful when daemon is MaxFibers(_).
while_cond: Option<String>Polydat boolean expression evaluated on the daemon’s fiber inside the wrapper stack. When set, the daemon body runs a loop: while the condition is truthy, dispatch the inner op; when falsy or stop-signalled, exit.
while: composes inside if: (which gates whether the
loop starts at all) and outside the per-op-rate
throttling (which paces iterations).
Parser invariants:
while:on a non-daemon op is currently allowed but blocks the cycle-pool fiber until the loop exits. The common use case is daemon + while.
rate: Option<String>Per-op rate spec governing the iteration cadence of the
while-loop (or per-cycle dispatch for non-loop ops).
Format: "<N>" (N/s, bare integer), "<N>/s",
"<N>/m", "<N>/h". Each op with rate: gets its own
RateLimiter at phase init — INDEPENDENT of the
activity-level rate: and of other ops’ rate limiters.
rate: 0 is “unlimited” (no throttling).