pub struct ClusterConfig { /* private fields */ }Expand description
Addresses of the five MVP processes: S, P, O, string-registry, compute.
Implementations§
Source§impl ClusterConfig
impl ClusterConfig
Sourcepub fn new(
hexastore: impl IntoIterator<Item = (PartitionAxis, SocketAddr)>,
registry: impl IntoIterator<Item = (RegistryNodeId, SocketAddr)>,
compute: SocketAddr,
) -> Result<Self, RouterError>
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.
Sourcepub fn local_dev() -> Self
pub fn local_dev() -> Self
Default local cluster: S/P/O on :7001–:7003, registry :7004, compute :7005.
Sourcepub fn from_toml_str(toml: &str) -> Result<Self, RouterError>
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"Sourcepub fn validate(&self) -> Result<(), RouterError>
pub fn validate(&self) -> Result<(), RouterError>
Every hexastore axis is addressed and at least one registry node exists.
Sourcepub fn hexastore(&self, axis: PartitionAxis) -> Result<SocketAddr, RouterError>
pub fn hexastore(&self, axis: PartitionAxis) -> Result<SocketAddr, RouterError>
Address of the hexastore partition owning axis.
Sourcepub fn registry(&self, node: RegistryNodeId) -> Result<SocketAddr, RouterError>
pub fn registry(&self, node: RegistryNodeId) -> Result<SocketAddr, RouterError>
Address of a specific registry node.
Sourcepub fn registry_nodes(
&self,
) -> impl Iterator<Item = (RegistryNodeId, SocketAddr)> + '_
pub fn registry_nodes( &self, ) -> impl Iterator<Item = (RegistryNodeId, SocketAddr)> + '_
Every configured registry node and its address (MVP: a single entry).
Sourcepub fn registry_for_hash(
&self,
hash: StrHash,
) -> Result<SocketAddr, RouterError>
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.
Sourcepub fn compute(&self) -> SocketAddr
pub fn compute(&self) -> SocketAddr
Address of this process’s compute gRPC listener.
Sourcepub fn self_id(&self) -> &str
pub fn self_id(&self) -> &str
Id of this process in Self::computes.
Sourcepub fn computes(&self) -> &[ComputeSpec]
pub fn computes(&self) -> &[ComputeSpec]
Static compute membership (includes this process).
Sourcepub fn self_spec(&self) -> Result<&ComputeSpec, RouterError>
pub fn self_spec(&self) -> Result<&ComputeSpec, RouterError>
This process’s ComputeSpec.
Sourcepub fn with_advertised_urls(self, rdf4j_url: String, admin_url: String) -> Self
pub fn with_advertised_urls(self, rdf4j_url: String, admin_url: String) -> Self
Replace advertised HTTP URLs on this process’s spec.
Sourcepub fn process_count(&self) -> usize
pub fn process_count(&self) -> usize
Total processes described: hexastore axes, registries, and compute nodes.
Sourcepub fn router(&self, vnodes_per_node: u32) -> Result<Router, RouterError>
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.
Sourcepub fn routing_snapshot(
&self,
router: &Router,
) -> Result<RoutingSnapshot, RouterError>
pub fn routing_snapshot( &self, router: &Router, ) -> Result<RoutingSnapshot, RouterError>
Murmur3 hexastore rings plus registry addresses.
Trait Implementations§
Source§impl Clone for ClusterConfig
impl Clone for ClusterConfig
Source§fn clone(&self) -> ClusterConfig
fn clone(&self) -> ClusterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more