Skip to main content

PluginEnv

Struct PluginEnv 

Source
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: SnapshotId

MVCC 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,