Skip to main content

Module cluster

Module cluster 

Source
Expand description

Cluster layer: pools, peers, datacenters, racks, gossip, snitch, vnode dispatch, and the cluster-aware Dispatcher implementation.

This module owns the cluster-wide data structures the C reference engine threaded through struct server_pool and the peer/dc/rack arrays. It is the seam between the per-connection state machines from crate::net (which only know about a single peer) and the routing logic that decides which peers receive a given request.

Public surface:

§Examples

use dynomite::cluster::peer::{Peer, PeerEndpoint};
use dynomite::hashkit::DynToken;
let p = Peer::new(
    0,
    PeerEndpoint::tcp("127.0.0.1".into(), 8101),
    "rack1".into(),
    "dc1".into(),
    vec![DynToken::from_u32(1)],
    true,
    true,
    false,
);
assert_eq!(p.dc(), "dc1");

Re-exports§

pub use self::admin_rpc::ClusterAdmin;
pub use self::admin_rpc::ClusterChange;
pub use self::admin_rpc::ClusterChangeKind;
pub use self::admin_rpc::ClusterError;
pub use self::admin_rpc::JoinPlan;
pub use self::admin_rpc::NoopClusterAdmin;
pub use self::admin_rpc::PeerSnapshot;
pub use self::admin_rpc::PeerSpec;
pub use self::admin_rpc::PoolClusterAdmin;
pub use self::apl::get_apl_ann;
pub use self::apl::AnnotatedPeer;
pub use self::apl::NodeRole;
pub use self::datacenter::Continuum;
pub use self::datacenter::Datacenter;
pub use self::datacenter::Rack;
pub use self::dispatch::ClusterDispatcher;
pub use self::dispatch::DispatchPlan;
pub use self::dispatch::ReplicaTarget;
pub use self::gossip::parse_seed_node;
pub use self::gossip::GossipConfig;
pub use self::gossip::GossipHandler;
pub use self::gossip::GossipNode;
pub use self::gossip::GossipState;
pub use self::gossip::GossipStep;
pub use self::gossip::SeedRecord;
pub use self::hints::Hint;
pub use self::hints::HintStore;
pub use self::hints::HintStoreError;
pub use self::hints::HintStoreStats;
pub use self::peer::Peer;
pub use self::peer::PeerEndpoint;
pub use self::peer::PeerState;
pub use self::pool::PoolConfig;
pub use self::pool::ServerPool;
pub use self::snitch::rack_distance;
pub use self::snitch::RackDistance;
pub use self::vnode::dispatch as vnode_dispatch;
pub use self::vnode::rebuild_continuums;
pub use self::vnode::PeerTokens;

Modules§

admin_rpc
Cluster admin RPC surface.
apl
Active preference list (APL) annotations for the vnode walker.
capability
Cluster-wide capability negotiation.
coverage
Token-ring coverage validation.
datacenter
Cluster topology: datacenters, racks, and the per-rack token continuum.
dispatch
Cluster-aware Dispatcher.
failure_detector
Phi-accrual failure detector.
gossip
Gossip state machine and seed-list bookkeeping.
hints
Node-local hinted-handoff store.
peer
Cluster peer state.
pool
Server pool owner.
snitch
Node snitch: environment-driven address resolution and rack proximity helpers.
vnode
Token ring math: building and querying per-rack continuums.