Expand description
Generic plugin seams: writes, plan, and execution.
Four traits; waratah_geo implements all of them, waratah_temporal the
write/planner/executor trio (its terms are storage-native, no encode hook):
WritePluginruns before the hexastore RPC on the insert path (gRPC fan-out and offline import alike). It returns a sparse object-rewrite overlay (PreparedInsert::object_rewrites), registry blob puts, and opaque O-axis index postings (geo + temporal) sent with the samecommit_ts— Put-shaped only: on Delete batches the fan-out discards the postings (term-keyed indexes are never retracted on delete; the rebuilds GC dead terms). Compute itself contains no geozero, PROJ, S2, or temporal datatype logic.EncodePluginclaims datatype IRIs (geo:wktLiteral,geo:wkbLiteral). Every SPARQL/RDF user literal of a claimed datatype routes throughencode_user_literal(FILTER / CONSTRUCT / BIND / BGP constants included); native terms decode back throughdecode_user_literalat materialization. The temporal plugin claims NO datatypes: its terms (xsd:dateTime,xsd:date,xsd:gYear, …) are storage-native already.PlannerPluginrewrites loweredPlanNodetrees. The geo rewrite inspectsFilter.residualconjuncts and recurses into inner plans and EXISTS clause bodies (neverearly; that tree is all that surviveslower_pattern+split_filter), and must not drop rows unless its custom op is a complete implementation of the stripped conjunct. Repeat executions of an uncorrelated (childless) custom op — EXISTS NestedProbe re-opens, expr-subst groups, duplicate identical conjuncts — are covered by the query-local CustomOp memo (seeExecutorPlugin).ExecutorPlugindispatchesPlanNode::CustomNodeon both evaluation paths. Ageo_scan/temporal_scanop materializes (drains its stream once) — OpenNode pages the local table, never a second scan RPC.
Registration is COMPOSED through PluginHost: every plugin crate
exposes a register(&mut PluginHost) that adds its RegisteredPlugin
and its custom functions to ONE host, and the binary installs the
composed host process-wide exactly once
(PluginHost::install_process_wide) BEFORE any query is lowered —
QueryEngine::new installs the plain builtin casts on the same process
CustomFunctions map (first install wins), so a late or second
registration would leave geof:* / tf:* FILTERs erroring Unsupported
in split_filter rather than planning wrong.
Structs§
- Plugin
Env - Execution environment handed to
ExecutorPlugin. - Plugin
Host - Composition point for the process-wide plugin + custom-function registries.
- Plugin
Payload Box - Cloneable, comparable box over
PluginPayloadsoPlanNodecan keep its derivedClone/PartialEq/Debug. - Plugin
Registry - Process-wide plugin set: datatype map + hooks, registered at startup.
- Prepared
Insert - What a
WritePluginreturns for one insert batch. - Registered
Plugin - One registered plugin bundle.
Traits§
- Encode
Plugin - Datatype-owner hook: encode + decode user literals of claimed IRIs.
- Executor
Plugin - Executor hook for
PlanNode::CustomNode. - Planner
Plugin - Plan-rewrite hook over the LOWERED plan tree.
- Plugin
Payload - Typed payload of a
PlanNode::CustomNode(downcast inside the plugin — never a stringly blob). - Write
Plugin - Write-path hook (runs on ingest and offline import alike).
Functions§
- decode_
user_ literal - Decode a native plugin term back to its lexical form.
- encode_
user_ literal - Encode a SPARQL/RDF user literal through the plugin datatype map.
- encode_
user_ literal_ with_ payloads encode_user_literalwith the mint’s payload pairs retained — the form every seeding site uses (the term-only wrapper serves matching and comparison sites that never decode). The pairs are the only copy of a query constant’s blob payload; seeEncodePlugin::encode_literal.- install_
process_ plugins - Install the process-lifetime plugin registry (first install wins, like
the custom-function registry). Called by
ComputeNodestartup; a second call is a no-op andregistryis dropped. - process_
plugins - The process plugin registry (empty when nothing was installed, so library tests and plugin-less deployments take the plain path).
- variable
- Variable helper: build a plan-time
Variable.
Type Aliases§
- BlobsFn
- Batched blob-fetch closure type (
PluginEnv::blobs). - Execute
Future - Materialized-row future of
ExecutorPlugin::execute. - GeoCandidates
Fn - Candidate-drain closure type (
PluginEnv::geo_candidates). - Strings
Fn - Batched registry-string-resolve closure type (
PluginEnv::strings). - Temporal
Candidates Fn - Candidate-drain closure type (
PluginEnv::temporal_candidates). - Text
Candidates Fn - Candidate-drain closure type (
PluginEnv::text_candidates). - Text
Subjects Fn - Subject-resolve closure type (
PluginEnv::text_subjects).