Skip to main content

Module datacenter

Module datacenter 

Source
Expand description

Cluster topology: datacenters, racks, and the per-rack token continuum.

A Datacenter owns a list of Racks; a Rack owns a vector of Continuum points that map a DynToken to the index of the crate::cluster::peer::Peer that owns the token. The shape mirrors the reference engine’s struct datacenter / struct rack / struct continuum exactly.

Token ring lookups use the same upper-bound search as the reference engine’s vnode_dispatch (the search lives in crate::cluster::vnode). The data shape stays here so the lookup can be tested against curated continua without spinning up a full pool.

§Examples

use dynomite::cluster::datacenter::{Datacenter, Rack};
let mut dc = Datacenter::new("dc1".into());
dc.upsert_rack("rack1".into());
assert_eq!(dc.racks().len(), 1);

Structs§

Continuum
One ring point: a (token, peer_idx) mapping.
Datacenter
One datacenter.
Rack
One rack within a datacenter.

Enums§

RackRing
Per-rack ring storage. Either the historical token continuum (a sorted Vec<Continuum>) or a RandomSlices table. The dispatcher consults whichever variant is present without caring which one it is; the engine produces only one shape per rack at a time.