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() |
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)
slot
- executors
- public void unassignBySlot(WorkerSlot slot)
slot
- public boolean isSlotOccupied(WorkerSlot slot)
isSlotOccupied
in interface SchedulerAssignment
slot
- public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignment
isExecutorAssigned
in interface SchedulerAssignment
public String getTopologyId()
SchedulerAssignment
getTopologyId
in interface SchedulerAssignment
public Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignment
getExecutorToSlot
in interface SchedulerAssignment
public Set<ExecutorDetails> getExecutors()
getExecutors
in interface SchedulerAssignment
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.