pub struct InternalScaleRequest {
pub service: String,
pub replicas: u32,
pub assignments: Vec<ScaleAssignment>,
pub spec: Option<Box<ServiceSpec>>,
}Expand description
Wire-format scale request fanned out by the cluster’s leader to each node that gets assigned at least one replica of a service.
The leader’s placement engine produces a HashMap<NodeId, Vec<(role, index)>>
of assignments; each entry becomes one InternalScaleRequest HTTP POST.
Backward-compatible: a peer may send {service, replicas} without
assignments. Receiving nodes treat that as a single implicit
{role: "default", indices: 0..replicas} group.
Fields§
§service: StringService name.
replicas: u32Total target replica count for this node, when caller didn’t supply
explicit per-role assignments (legacy / Phase 1 shape). When
assignments is non-empty, this field is informational.
assignments: Vec<ScaleAssignment>Per-role-group container index lists. Empty in Phase 1; populated by
Phase 2 once replica_groups + cross-node identity ship.
spec: Option<Box<ServiceSpec>>The full service spec, propagated so the receiving node can register
(or update) the service before scaling. This is what lets a fresh
worker run a replica it has never seen, and what makes an image change
on the leader reach worker containers: the receiver upserts this spec,
which detects digest drift and rolls the local replicas. None on the
legacy {service, replicas} shape (receiver falls back to its cached
spec). Boxed because ServiceSpec is large.
Implementations§
Source§impl InternalScaleRequest
impl InternalScaleRequest
Sourcepub fn new(service: impl Into<String>, replicas: u32) -> Self
pub fn new(service: impl Into<String>, replicas: u32) -> Self
Build a legacy {service, replicas} request (Phase 1).
Sourcepub fn with_spec(self, spec: ServiceSpec) -> Self
pub fn with_spec(self, spec: ServiceSpec) -> Self
Attach the full service spec so the receiver can register/update the
service before scaling (image-change propagation + first-deploy on a
fresh worker). Chainable onto Self::new / Self::with_assignments.
Sourcepub fn with_assignments(
service: impl Into<String>,
assignments: Vec<ScaleAssignment>,
) -> Self
pub fn with_assignments( service: impl Into<String>, assignments: Vec<ScaleAssignment>, ) -> Self
Build a Phase-2 request with explicit per-role assignments.
Trait Implementations§
Source§impl Clone for InternalScaleRequest
impl Clone for InternalScaleRequest
Source§fn clone(&self) -> InternalScaleRequest
fn clone(&self) -> InternalScaleRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more