Skip to main content

ComputeNode

Struct ComputeNode 

Source
pub struct ComputeNode<H = GrpcHexastoreClients, R = GrpcRegistryClients> { /* private fields */ }
Expand description

Connected compute coordinator.

Default type parameters are the gRPC adapters used by the spawned-cluster path. ComputeNode::from_clients accepts any types that implement the hexastore / registry client traits (in-process adapters in waratah_bin).

Implementations§

Source§

impl<H, R> ComputeNode<H, R>

Source

pub fn from_clients( hexastore: H, registry: R, router: Router, retry: RetryPolicy, ) -> Self
where H: Clone, R: Clone,

Wire write fan-out and query execution over already-built clients, sharing them.

Source

pub fn fanout(&self) -> &WriteFanout<H, R>

Write fan-out coordinator.

Source

pub fn queries(&self) -> &QueryEngine<H, R>

SELECT / ASK / CONSTRUCT / DESCRIBE execution engine.

Source

pub fn with_describe_mode(self, mode: DescribeMode) -> Self

Set the DESCRIBE algorithm (star default).

Source

pub fn set_path_pair_budget(&mut self, budget: u64)

Distinct-pair circuit breaker for bound / one-end property paths.

Source

pub fn set_open_star_pair_budget(&mut self, budget: u64)

Distinct-pair circuit breaker for * / + with no LIMIT.

Source

pub fn with_path_pair_budget(self, budget: u64) -> Self

Builder: set the bound / one-end path pair budget.

Source

pub fn with_open_star_pair_budget(self, budget: u64) -> Self

Builder: set the open-* / + pair budget.

Source

pub fn set_default_union(&mut self, default_union: bool)

SPARQL default-graph fallback (false = RDF unnamed graph only).

Source

pub fn with_default_union(self, default_union: bool) -> Self

Builder: SPARQL default-graph fallback.

Source

pub fn seat_by_total_cost(&self) -> bool

Inner-join seating comparator currently configured (false = legacy driver_cost decision). Read by the EXPLAIN route so HTTP explain shows the seat the server will run.

Source

pub fn set_seat_by_total_cost(&mut self, seat_by_total_cost: bool)

Seat inner joins by the total seating cost (the join-seat-shadow comparator promoted to decision).

Source

pub fn with_seat_by_total_cost(self, seat_by_total_cost: bool) -> Self

Builder: seat inner joins by the total seating cost.

Source

pub fn set_force_semi(&mut self, force_semi: bool)

Benchmark switch: force Semi past a PerPage cost verdict. The semantic semi gates still refuse.

Source

pub fn with_force_semi(self, force_semi: bool) -> Self

Builder: force Semi past a PerPage cost verdict.

Source

pub fn eager_scan_filter(&self) -> bool

Whether scans stamp and apply slot comparisons (true by default).

Source

pub fn set_eager_scan_filter(&mut self, enabled: bool)

Toggle slot comparison pushdown and the eager scan filter. The equivalence battery turns it off to prove the answers match the plain plan FILTER; off is the pre-feature path (nothing stamped).

Source

pub fn with_eager_scan_filter(self, enabled: bool) -> Self

Builder: toggle the compute-side eager scan filter.

Source

pub fn set_geo_index_epoch(&mut self, geo_index_epoch: Option<u64>)

Geo-index rebuild epoch copied onto each QueryContext (None = trusted). Set at startup from the O partition’s Describe payload.

Source

pub fn set_temporal_index_epoch(&mut self, temporal_index_epoch: Option<u64>)

Set the temporal-index rebuild epoch (copied onto every query context; None = untrusted).

Source

pub fn set_text_index_state( &mut self, epoch: Option<u64>, fingerprint: impl Into<Arc<str>>, )

Set the text-index rebuild epoch and config fingerprint (copied onto every query context; None epoch = untrusted, both text rewrites off).

Source

pub fn with_geo_index_epoch(self, geo_index_epoch: Option<u64>) -> Self

Builder: geo-index rebuild epoch (None = trusted).

Source

pub fn spill_root(&self) -> Option<&Path>

Spill root for per-query spill files (None = std::env::temp_dir).

Source

pub fn set_spill_root(&mut self, spill_root: Option<PathBuf>)

Set the spill root copied onto each QueryContext this node builds.

Source

pub fn with_spill_root(self, spill_root: Option<PathBuf>) -> Self

Builder: spill root copied onto each QueryContext this node builds.

Source

pub fn with_cluster_config(self, config: ClusterConfig) -> Self

Attach the static cluster membership this process uses for Describe/HTTP.

Source

pub fn cluster_config(&self) -> Option<&ClusterConfig>

Static cluster config when this node was constructed with one.

Source

pub fn standalone(&self) -> bool

In-process S/P/O + registry (waratah standalone).

Source

pub fn with_standalone(self, standalone: bool) -> Self

Builder: in-process storage (no hexastore/registry gRPC).

Source§

impl ComputeNode<GrpcHexastoreClients, GrpcRegistryClients>

Source

pub async fn connect( config: &ClusterConfig, retry: RetryPolicy, ) -> Result<Self, ComputeError>

Dial every address in config, sharing channels between both paths.

Source§

impl<H: HexastoreInsert + HexastoreGeo, R: StringRegister + BlobStoreClient> ComputeNode<H, R>

Source

pub async fn insert_quads( &self, quads: &[Quad], commit_ts: CommitTs, ) -> Result<InsertResult, ComputeError>

Write path: encode once, register strings, fan out to S/P/O.

Source§

impl<H: HexastoreScan + HexastoreCatalog + HexastoreGeo, R: StringResolve + BlobStoreClient> ComputeNode<H, R>

Source

pub async fn query( &self, sparql: &str, snapshot: SnapshotId, ) -> Result<QueryResults, ComputeError>

Read path: SPARQL SELECT / ASK / CONSTRUCT / DESCRIBE as of snapshot.

Builds a default QueryContext from this node’s engine knobs. Prefer Self::query_with when the caller already has a context (API query id, debug sinks).

Source

pub async fn query_with( &self, sparql: &str, ctx: &QueryContext, ) -> Result<QueryResults, ComputeError>

Same as Self::query with a caller-supplied QueryContext.

Source

pub async fn query_output( &self, sparql: &str, ctx: &QueryContext, ) -> Result<QueryOutput, ComputeError>

SELECT as encoded rows plus a resolved string map; ASK / graph as QueryResults.

Source

pub fn context(&self, snapshot: SnapshotId) -> QueryContext

Default QueryContext for this node’s engine knobs (query id 0).

Customize with QueryContext::with_* builders and run through Self::query_with — e.g. with_base_iri to resolve relative IRIs in the query text.

Source

pub async fn quad_count( &self, snapshot: SnapshotId, ) -> Result<u64, ComputeError>

Count quads visible as of snapshot (unbound S/SPOG prefix count).

Source§

impl<H: HexastoreFlush, R: StringRegistryFlush> ComputeNode<H, R>

Source

pub async fn flush_memtables(&self) -> Result<(), ComputeError>

Flush MemTables to SST on S, P, O, and the registry (no-op on memory).

Source§

impl<H: HexastoreCompact, R: StringRegistryCompact> ComputeNode<H, R>

Source

pub async fn compact_range(&self) -> Result<(), ComputeError>

Compact S, P, O, and the registry (no-op on memory backends).

Source§

impl<H: HexastoreAdmin, R: RegistryAdmin> ComputeNode<H, R>

Source

pub async fn cluster_snapshot( &self, knobs: ClusterKnobs, ) -> Option<ClusterSnapshot>

Probe storage + peer computes and return a cluster snapshot.

Source§

impl<H: HexastoreStats, R> ComputeNode<H, R>

Source

pub async fn refresh_stats(&self) -> Result<StatsProfile, ComputeError>

Pull shard sketch profiles into the local planner cache (Phase 7).

waratah start always calls this after connect so SST waratah.stats from an existing data-dir reach the planner (not only --load-demo).

Source§

impl<H: HexastoreCatalog, R> ComputeNode<H, R>

Source

pub async fn list_named_graphs( &self, snapshot: SnapshotId, ) -> Result<Vec<EncodedTerm>, ComputeError>

List S-axis named graphs visible at snapshot (empty graphs included).

Source

pub async fn add_named_graph( &self, graph: &EncodedTerm, commit_ts: CommitTs, ) -> Result<(), ComputeError>

Insert an empty named graph on the S-axis catalog (no-op if already Present).

Source§

impl<H: HexastoreScan + HexastoreCatalog + HexastoreGeo, R: StringResolve + BlobStoreClient> ComputeNode<H, R>

Source

pub async fn schema_summary( &self, params: &SchemaSummaryParams, ) -> Result<SchemaSummary, ComputeError>

Build the schema summary (contract S2). See the module doc for why this issues internal SPARQL instead of reading the axes directly.

Source

pub async fn union_quad_count( &self, snapshot: SnapshotId, ) -> Result<u64, ComputeError>

Total visible quads across the default graph and every named graph (unbound-S SPOG prefix count, no graph filter). This is what the summary’s tripleCount reports.

Trait Implementations§

Source§

impl<H: Clone, R: Clone> Clone for ComputeNode<H, R>

Source§

fn clone(&self) -> ComputeNode<H, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H: Debug, R: Debug> Debug for ComputeNode<H, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H, R> Freeze for ComputeNode<H, R>
where H: Freeze, R: Freeze,

§

impl<H, R> RefUnwindSafe for ComputeNode<H, R>

§

impl<H, R> Send for ComputeNode<H, R>
where H: Send, R: Send,

§

impl<H, R> Sync for ComputeNode<H, R>
where H: Sync, R: Sync,

§

impl<H, R> Unpin for ComputeNode<H, R>
where H: Unpin, R: Unpin,

§

impl<H, R> UnsafeUnpin for ComputeNode<H, R>
where H: UnsafeUnpin, R: UnsafeUnpin,

§

impl<H, R> UnwindSafe for ComputeNode<H, R>
where H: UnwindSafe, R: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,