pub struct Router { /* private fields */ }Expand description
Murmur3 ring router with a static address table (local-dev MVP).
Implementations§
Source§impl Router
impl Router
Sourcepub fn new(
s_nodes: impl IntoIterator<Item = NodeId>,
p_nodes: impl IntoIterator<Item = NodeId>,
o_nodes: impl IntoIterator<Item = NodeId>,
vnodes_per_node: u32,
table: RoutingTable,
) -> Self
pub fn new( s_nodes: impl IntoIterator<Item = NodeId>, p_nodes: impl IntoIterator<Item = NodeId>, o_nodes: impl IntoIterator<Item = NodeId>, vnodes_per_node: u32, table: RoutingTable, ) -> Self
Build a router from per-axis node lists and a shared address table.
vnodes_per_node controls virtual-node density on each axis ring.
Sourcepub fn table(&self) -> &RoutingTable
pub fn table(&self) -> &RoutingTable
Shared routing table.
Sourcepub fn vnodes_per_node(&self) -> u32
pub fn vnodes_per_node(&self) -> u32
Virtual nodes placed on each physical node of an axis ring.
Sourcepub fn ring(&self, axis: PartitionAxis) -> &HashRing
pub fn ring(&self, axis: PartitionAxis) -> &HashRing
Ring for axis.
Sourcepub fn snapshot(&self) -> Result<RoutingSnapshot, RouterError>
pub fn snapshot(&self) -> Result<RoutingSnapshot, RouterError>
Dump physical hexastore nodes and vnode density (registry is filled by [ClusterConfig]).
Sourcepub fn hexastore_nodes(&self) -> Result<Vec<RoutedNode>, RouterError>
pub fn hexastore_nodes(&self) -> Result<Vec<RoutedNode>, RouterError>
Hexastore nodes this router knows about (axis, node id, listen address).
Sourcepub fn route_pattern(
&self,
pattern: &EncodedTriplePattern,
) -> Result<Route, RouterError>
pub fn route_pattern( &self, pattern: &EncodedTriplePattern, ) -> Result<Route, RouterError>
Select (PartitionAxis, IndexPermutation, NodeId) for pattern.
Sourcepub fn route_and_resolve(
&self,
pattern: &EncodedTriplePattern,
) -> Result<(Route, SocketAddr), RouterError>
pub fn route_and_resolve( &self, pattern: &EncodedTriplePattern, ) -> Result<(Route, SocketAddr), RouterError>
Route and resolve the listen address from the routing table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router
impl RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin for Router
impl UnwindSafe for Router
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
Mutably borrows from an owned value. Read more