Skip to main content

ClusterConfig

Struct ClusterConfig 

Source
pub struct ClusterConfig { /* private fields */ }
Expand description

Addresses of the five MVP processes: S, P, O, string-registry, compute.

Implementations§

Source§

impl ClusterConfig

Source

pub fn new( hexastore: impl IntoIterator<Item = (PartitionAxis, SocketAddr)>, registry: impl IntoIterator<Item = (RegistryNodeId, SocketAddr)>, compute: SocketAddr, ) -> Result<Self, RouterError>

Build from explicit tables, rejecting an incomplete cluster.

Source

pub fn local_dev() -> Self

Default local cluster: S/P/O on :7001–:7003, registry :7004, compute :7005.

Source

pub fn from_toml_str(toml: &str) -> Result<Self, RouterError>

Parse the static config waratah_bin injects into compute.

compute = "127.0.0.1:7005"

[hexastore]
s = "127.0.0.1:7001"
p = "127.0.0.1:7002"
o = "127.0.0.1:7003"

[registry]
0 = "127.0.0.1:7004"
Source

pub fn validate(&self) -> Result<(), RouterError>

Every hexastore axis is addressed and at least one registry node exists.

Source

pub fn hexastore(&self, axis: PartitionAxis) -> Result<SocketAddr, RouterError>

Address of the hexastore partition owning axis.

Source

pub fn registry(&self, node: RegistryNodeId) -> Result<SocketAddr, RouterError>

Address of a specific registry node.

Source

pub fn registry_nodes( &self, ) -> impl Iterator<Item = (RegistryNodeId, SocketAddr)> + '_

Every configured registry node and its address (MVP: a single entry).

Source

pub fn registry_for_hash( &self, hash: StrHash, ) -> Result<SocketAddr, RouterError>

Registry node owning hash (murmur3(StrHash) % registry_node_count).

MVP has a single registry process, so this always resolves to node 0; the sharding stays here so splitting the registry later is a config change rather than a call-site change.

Source

pub fn compute(&self) -> SocketAddr

Address of this process’s compute gRPC listener.

Source

pub fn self_id(&self) -> &str

Id of this process in Self::computes.

Source

pub fn computes(&self) -> &[ComputeSpec]

Static compute membership (includes this process).

Source

pub fn self_spec(&self) -> Result<&ComputeSpec, RouterError>

This process’s ComputeSpec.

Source

pub fn with_advertised_urls(self, rdf4j_url: String, admin_url: String) -> Self

Replace advertised HTTP URLs on this process’s spec.

Source

pub fn process_count(&self) -> usize

Total processes described: hexastore axes, registries, and compute nodes.

Source

pub fn router(&self, vnodes_per_node: u32) -> Result<Router, RouterError>

Build a pattern Router over one node per axis, addressed from this config.

Node ids follow <axis>-0; multi-node axes arrive with real sharding.

Source

pub fn routing_snapshot( &self, router: &Router, ) -> Result<RoutingSnapshot, RouterError>

Murmur3 hexastore rings plus registry addresses.

Trait Implementations§

Source§

impl Clone for ClusterConfig

Source§

fn clone(&self) -> ClusterConfig

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 Debug for ClusterConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ClusterConfig

Source§

fn eq(&self, other: &ClusterConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ClusterConfig

Source§

impl StructuralPartialEq for ClusterConfig

Auto Trait Implementations§

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.

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.

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<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,