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>
impl<H, R> ComputeNode<H, R>
Sourcepub fn from_clients(
hexastore: H,
registry: R,
router: Router,
retry: RetryPolicy,
) -> Self
pub fn from_clients( hexastore: H, registry: R, router: Router, retry: RetryPolicy, ) -> Self
Wire write fan-out and query execution over already-built clients, sharing them.
Sourcepub fn fanout(&self) -> &WriteFanout<H, R>
pub fn fanout(&self) -> &WriteFanout<H, R>
Write fan-out coordinator.
Sourcepub fn queries(&self) -> &QueryEngine<H, R>
pub fn queries(&self) -> &QueryEngine<H, R>
SELECT / ASK / CONSTRUCT / DESCRIBE execution engine.
Sourcepub fn with_describe_mode(self, mode: DescribeMode) -> Self
pub fn with_describe_mode(self, mode: DescribeMode) -> Self
Set the DESCRIBE algorithm (star default).
Sourcepub fn set_path_pair_budget(&mut self, budget: u64)
pub fn set_path_pair_budget(&mut self, budget: u64)
Distinct-pair circuit breaker for bound / one-end property paths.
Sourcepub fn set_open_star_pair_budget(&mut self, budget: u64)
pub fn set_open_star_pair_budget(&mut self, budget: u64)
Distinct-pair circuit breaker for * / + with no LIMIT.
Sourcepub fn with_path_pair_budget(self, budget: u64) -> Self
pub fn with_path_pair_budget(self, budget: u64) -> Self
Builder: set the bound / one-end path pair budget.
Sourcepub fn with_open_star_pair_budget(self, budget: u64) -> Self
pub fn with_open_star_pair_budget(self, budget: u64) -> Self
Builder: set the open-* / + pair budget.
Sourcepub fn set_default_union(&mut self, default_union: bool)
pub fn set_default_union(&mut self, default_union: bool)
SPARQL default-graph fallback (false = RDF unnamed graph only).
Sourcepub fn with_default_union(self, default_union: bool) -> Self
pub fn with_default_union(self, default_union: bool) -> Self
Builder: SPARQL default-graph fallback.
Sourcepub fn seat_by_total_cost(&self) -> bool
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.
Sourcepub fn set_seat_by_total_cost(&mut self, seat_by_total_cost: bool)
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).
Sourcepub fn with_seat_by_total_cost(self, seat_by_total_cost: bool) -> Self
pub fn with_seat_by_total_cost(self, seat_by_total_cost: bool) -> Self
Builder: seat inner joins by the total seating cost.
Sourcepub fn set_force_semi(&mut self, force_semi: bool)
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.
Sourcepub fn with_force_semi(self, force_semi: bool) -> Self
pub fn with_force_semi(self, force_semi: bool) -> Self
Builder: force Semi past a PerPage cost verdict.
Sourcepub fn eager_scan_filter(&self) -> bool
pub fn eager_scan_filter(&self) -> bool
Whether scans stamp and apply slot comparisons (true by default).
Sourcepub fn set_eager_scan_filter(&mut self, enabled: bool)
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).
Sourcepub fn with_eager_scan_filter(self, enabled: bool) -> Self
pub fn with_eager_scan_filter(self, enabled: bool) -> Self
Builder: toggle the compute-side eager scan filter.
Sourcepub fn set_geo_index_epoch(&mut self, geo_index_epoch: Option<u64>)
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.
Sourcepub fn set_temporal_index_epoch(&mut self, temporal_index_epoch: Option<u64>)
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).
Sourcepub fn set_text_index_state(
&mut self,
epoch: Option<u64>,
fingerprint: impl Into<Arc<str>>,
)
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).
Sourcepub fn with_geo_index_epoch(self, geo_index_epoch: Option<u64>) -> Self
pub fn with_geo_index_epoch(self, geo_index_epoch: Option<u64>) -> Self
Builder: geo-index rebuild epoch (None = trusted).
Sourcepub fn spill_root(&self) -> Option<&Path>
pub fn spill_root(&self) -> Option<&Path>
Spill root for per-query spill files (None = std::env::temp_dir).
Sourcepub fn set_spill_root(&mut self, spill_root: Option<PathBuf>)
pub fn set_spill_root(&mut self, spill_root: Option<PathBuf>)
Set the spill root copied onto each QueryContext this node builds.
Sourcepub fn with_spill_root(self, spill_root: Option<PathBuf>) -> Self
pub fn with_spill_root(self, spill_root: Option<PathBuf>) -> Self
Builder: spill root copied onto each QueryContext this node builds.
Sourcepub fn with_cluster_config(self, config: ClusterConfig) -> Self
pub fn with_cluster_config(self, config: ClusterConfig) -> Self
Attach the static cluster membership this process uses for Describe/HTTP.
Sourcepub fn cluster_config(&self) -> Option<&ClusterConfig>
pub fn cluster_config(&self) -> Option<&ClusterConfig>
Static cluster config when this node was constructed with one.
Sourcepub fn standalone(&self) -> bool
pub fn standalone(&self) -> bool
In-process S/P/O + registry (waratah standalone).
Sourcepub fn with_standalone(self, standalone: bool) -> Self
pub fn with_standalone(self, standalone: bool) -> Self
Builder: in-process storage (no hexastore/registry gRPC).
Source§impl ComputeNode<GrpcHexastoreClients, GrpcRegistryClients>
impl ComputeNode<GrpcHexastoreClients, GrpcRegistryClients>
Sourcepub async fn connect(
config: &ClusterConfig,
retry: RetryPolicy,
) -> Result<Self, ComputeError>
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>
impl<H: HexastoreInsert + HexastoreGeo, R: StringRegister + BlobStoreClient> ComputeNode<H, R>
Sourcepub async fn insert_quads(
&self,
quads: &[Quad],
commit_ts: CommitTs,
) -> Result<InsertResult, ComputeError>
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>
impl<H: HexastoreScan + HexastoreCatalog + HexastoreGeo, R: StringResolve + BlobStoreClient> ComputeNode<H, R>
Sourcepub async fn query(
&self,
sparql: &str,
snapshot: SnapshotId,
) -> Result<QueryResults, ComputeError>
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).
Sourcepub async fn query_with(
&self,
sparql: &str,
ctx: &QueryContext,
) -> Result<QueryResults, ComputeError>
pub async fn query_with( &self, sparql: &str, ctx: &QueryContext, ) -> Result<QueryResults, ComputeError>
Same as Self::query with a caller-supplied QueryContext.
Sourcepub async fn query_output(
&self,
sparql: &str,
ctx: &QueryContext,
) -> Result<QueryOutput, ComputeError>
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.
Sourcepub fn context(&self, snapshot: SnapshotId) -> QueryContext
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.
Sourcepub async fn quad_count(
&self,
snapshot: SnapshotId,
) -> Result<u64, ComputeError>
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>
impl<H: HexastoreFlush, R: StringRegistryFlush> ComputeNode<H, R>
Sourcepub async fn flush_memtables(&self) -> Result<(), ComputeError>
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>
impl<H: HexastoreCompact, R: StringRegistryCompact> ComputeNode<H, R>
Sourcepub async fn compact_range(&self) -> Result<(), ComputeError>
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>
impl<H: HexastoreAdmin, R: RegistryAdmin> ComputeNode<H, R>
Sourcepub async fn cluster_snapshot(
&self,
knobs: ClusterKnobs,
) -> Option<ClusterSnapshot>
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>
impl<H: HexastoreStats, R> ComputeNode<H, R>
Sourcepub async fn refresh_stats(&self) -> Result<StatsProfile, ComputeError>
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>
impl<H: HexastoreCatalog, R> ComputeNode<H, R>
Sourcepub async fn list_named_graphs(
&self,
snapshot: SnapshotId,
) -> Result<Vec<EncodedTerm>, ComputeError>
pub async fn list_named_graphs( &self, snapshot: SnapshotId, ) -> Result<Vec<EncodedTerm>, ComputeError>
List S-axis named graphs visible at snapshot (empty graphs included).
Sourcepub async fn add_named_graph(
&self,
graph: &EncodedTerm,
commit_ts: CommitTs,
) -> Result<(), ComputeError>
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>
impl<H: HexastoreScan + HexastoreCatalog + HexastoreGeo, R: StringResolve + BlobStoreClient> ComputeNode<H, R>
Sourcepub async fn schema_summary(
&self,
params: &SchemaSummaryParams,
) -> Result<SchemaSummary, ComputeError>
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.
Sourcepub async fn union_quad_count(
&self,
snapshot: SnapshotId,
) -> Result<u64, ComputeError>
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>
impl<H: Clone, R: Clone> Clone for ComputeNode<H, R>
Source§fn clone(&self) -> ComputeNode<H, R>
fn clone(&self) -> ComputeNode<H, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<H, R> Freeze for ComputeNode<H, R>
impl<H, R> RefUnwindSafe for ComputeNode<H, R>where
H: RefUnwindSafe,
R: RefUnwindSafe,
impl<H, R> Send for ComputeNode<H, R>
impl<H, R> Sync for ComputeNode<H, R>
impl<H, R> Unpin for ComputeNode<H, R>
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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].