pub type WorkerSlotMapping = VnodeMapping<WorkerSlot>;
Expand description
A mapping from VirtualNode
to WorkerSlotId
.
Aliased Type§
struct WorkerSlotMapping {
original_indices: Vec<u32>,
data: Vec<WorkerSlotId>,
}
Fields§
§original_indices: Vec<u32>
§data: Vec<WorkerSlotId>
Implementations§
source§impl WorkerSlotMapping
impl WorkerSlotMapping
sourcepub fn build_from_ids(
worker_slot_ids: &[WorkerSlotId],
vnode_count: usize,
) -> Self
pub fn build_from_ids( worker_slot_ids: &[WorkerSlotId], vnode_count: usize, ) -> Self
Create a uniform worker mapping from the given worker ids
sourcepub fn from_protobuf(proto: &PbWorkerSlotMapping) -> Self
pub fn from_protobuf(proto: &PbWorkerSlotMapping) -> Self
Create a worker mapping from the protobuf representation.
sourcepub fn to_protobuf(&self) -> PbWorkerSlotMapping
pub fn to_protobuf(&self) -> PbWorkerSlotMapping
Convert this worker mapping to the protobuf representation.
source§impl WorkerSlotMapping
impl WorkerSlotMapping
sourcepub fn to_actor(&self, to_map: &HashMap<WorkerSlotId, ActorId>) -> ActorMapping
pub fn to_actor(&self, to_map: &HashMap<WorkerSlotId, ActorId>) -> ActorMapping
Transform this worker slot mapping to an actor mapping, essentially transform
.