pub trait KeyspaceNode:
Debug
+ Hash
+ PartialEq
+ Eq {
type Id: Debug + Hash + PartialEq + Eq + Clone;
// Required method
fn id(&self) -> Self::Id;
// Provided method
fn capacity(&self) -> usize { ... }
}Expand description
Node that stores data.
Node controls one or more intervals of the keyspace. Keys which fall into such an interval are routed to the node (and its replicas).
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn capacity(&self) -> usize
fn capacity(&self) -> usize
Capacity of the node.
The capacity is used to determine what portion of the keyspace the node will control. Since nodes are attached to keyspace portions using Highest Random Weight algorithm (HRW), the capacity affects the score of the node, thus the higher the capacity, the more likely the node will be chosen.
Capacities of all nodes are summed up to determine the total capacity of the keyspace. The relative capacity of the node is then ratio of the node’s capacity to the total capacity of the keyspace.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.