pub struct PluginEnv<'a> {
pub snapshot: SnapshotId,
pub geo_candidates: &'a GeoCandidatesFn<'a>,
pub temporal_candidates: &'a TemporalCandidatesFn<'a>,
pub text_candidates: &'a TextCandidatesFn<'a>,
pub text_subjects: &'a TextSubjectsFn<'a>,
pub blobs: &'a BlobsFn<'a>,
pub strings: &'a StringsFn<'a>,
pub pushed_vals: Option<&'a [EncodedTerm]>,
pub pushed_variable: Option<&'a Variable>,
}Expand description
Execution environment handed to ExecutorPlugin.
The closures keep the plugin crate free of client/gRPC types: compute adapts its hexastore + registry clients into six calls (three candidate drains — geo, temporal, text literals — the text subject resolve, one blob fetch, one string resolve).
Fields§
§snapshot: SnapshotIdMVCC snapshot of the running query.
geo_candidates: &'a GeoCandidatesFn<'a>Drain one GeoCandidateScan: merged cell-id intervals + optional
query envelope + per-drain limit → distinct visible candidate terms.
Never re-issued with a cursor (see the partition contract). The
service memoizes per window (QueryCaches::geo_drains): the
candidate list is key-invariant, so repeat drains of one window —
a keyed execution’s later driver pages, EXISTS re-opens — are
served without an RPC.
temporal_candidates: &'a TemporalCandidatesFn<'a>Drain one TemporalCandidateScan: merged node-key intervals + the
exact interval predicate + per-drain limit → distinct visible
candidate terms. Never re-issued with a cursor (see the partition
contract — a second RPC would restart the DISTINCT seen-set).
text_candidates: &'a TextCandidatesFn<'a>Drain one TextCandidateScan: search request → distinct candidate
terms. One call drains the whole set (never cursor-paged); the
engine memoizes per window (QueryCaches::text_drains) so repeat
drains of one window within the query are served without an RPC.
text_subjects: &'a TextSubjectsFn<'a>Resolve one TextSubjectScan: the subject-form request → DISTINCT
(subject, graph) rows. The partition runs the candidate search and
the OPSG resolve itself (the literal→subject join never crosses the
wire), streams framed pages, and enforces the request’s guard: an
over-limit set is an ERROR after the pages already sent, so a
consumer must treat a stream error as fatal and discard its rows.
The engine memoizes per window (QueryCaches::text_subjects) so a
re-execution of one window — a later driver page, an EXISTS re-open —
is served without a second resolve.
blobs: &'a BlobsFn<'a>Batched blob fetch: content ids → payloads aligned with the request
(None = miss). The executor’s 256 MiB LRU sits behind this in the
compute client adapter, so Relate and output materialization share
one cache.
strings: &'a StringsFn<'a>Batched registry-string resolve: encoded term value-hashes → raw
lexical strings aligned with the request (None = miss). Sits behind
the engine’s resolve cache like every other resolve path.
pushed_vals: Option<&'a [EncodedTerm]>Join-key values pushed from the driver into this op’s OUTPUT
variable (Some only on the probe side of a join whose driver
materialized the key column; None = driver side / no pushdown).
The list is the driver’s complete distinct binding set for the
variable, so an executor may treat it as the exact matching domain —
relating the keys directly or semi-joining a candidate sweep against
them. Executions WITH pushed values are not result-memoizable (see the
ExecutorPlugin contract); the candidate DRAIN behind
Self::geo_candidates is (key-invariant window), so a keyed
execution still shares one drain with the driver’s other pages.
pushed_variable: Option<&'a Variable>The variable Self::pushed_vals belongs to: the first output
variable of the op that the driver materialized. A single-output
plugin can ignore it; a multi-output one (the text subject form emits
subject and, when the query binds the graph, graph) needs it to
tell a push on one column from a push on the other, because
pushed_vals alone is an unlabelled term list.
Auto Trait Implementations§
impl<'a> Freeze for PluginEnv<'a>
impl<'a> !RefUnwindSafe for PluginEnv<'a>
impl<'a> Send for PluginEnv<'a>
impl<'a> Sync for PluginEnv<'a>
impl<'a> Unpin for PluginEnv<'a>
impl<'a> UnsafeUnpin for PluginEnv<'a>
impl<'a> !UnwindSafe for PluginEnv<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].