public class SchedulerAssignmentImpl extends Object implements SchedulerAssignment
Constructor and Description |
---|
SchedulerAssignmentImpl(String topologyId,
Map<ExecutorDetails,WorkerSlot> executorToSlots) |
Modifier and Type | Method and Description |
---|---|
void |
assign(WorkerSlot slot,
Collection<ExecutorDetails> executors)
Assign the slot to executors.
|
Set<ExecutorDetails> |
getExecutors()
Return the executors covered by this assignments
|
Map<ExecutorDetails,WorkerSlot> |
getExecutorToSlot()
get the executor -> slot map.
|
Set<WorkerSlot> |
getSlots() |
Map<WorkerSlot,Collection<ExecutorDetails>> |
getSlotToExecutors() |
String |
getTopologyId()
get the topology-id this assignment is for.
|
boolean |
isExecutorAssigned(ExecutorDetails executor)
is the executor assigned?
|
boolean |
isSlotOccupied(WorkerSlot slot)
Does this slot occupied by this assignment?
|
void |
unassignBySlot(WorkerSlot slot)
Release the slot occupied by this assignment.
|
public SchedulerAssignmentImpl(String topologyId, Map<ExecutorDetails,WorkerSlot> executorToSlots)
public Set<WorkerSlot> getSlots()
getSlots
in interface SchedulerAssignment
public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors)
Assign the slot to executors.
public void unassignBySlot(WorkerSlot slot)
Release the slot occupied by this assignment.
public boolean isSlotOccupied(WorkerSlot slot)
SchedulerAssignment
Does this slot occupied by this assignment?
isSlotOccupied
in interface SchedulerAssignment
slot
- public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignment
is the executor assigned?
isExecutorAssigned
in interface SchedulerAssignment
public String getTopologyId()
SchedulerAssignment
get the topology-id this assignment is for.
getTopologyId
in interface SchedulerAssignment
public Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignment
get the executor -> slot map.
getExecutorToSlot
in interface SchedulerAssignment
public Set<ExecutorDetails> getExecutors()
SchedulerAssignment
Return the executors covered by this assignments
getExecutors
in interface SchedulerAssignment
public Map<WorkerSlot,Collection<ExecutorDetails>> getSlotToExecutors()
getSlotToExecutors
in interface SchedulerAssignment
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.