risingwave_common::hash

Type Alias WorkerSlotMapping

source
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

source

pub fn build_from_ids( worker_slot_ids: &[WorkerSlotId], vnode_count: usize, ) -> Self

Create a uniform worker mapping from the given worker ids

source

pub fn from_protobuf(proto: &PbWorkerSlotMapping) -> Self

Create a worker mapping from the protobuf representation.

source

pub fn to_protobuf(&self) -> PbWorkerSlotMapping

Convert this worker mapping to the protobuf representation.

source§

impl WorkerSlotMapping

source

pub fn to_actor(&self, to_map: &HashMap<WorkerSlotId, ActorId>) -> ActorMapping

Transform this worker slot mapping to an actor mapping, essentially transform.