public class SchedulerAssignmentImpl extends Object implements SchedulerAssignment
| Constructor and Description |
|---|
SchedulerAssignmentImpl(SchedulerAssignment assignment) |
SchedulerAssignmentImpl(String topologyId) |
SchedulerAssignmentImpl(String topologyId,
Map<ExecutorDetails,WorkerSlot> executorToSlot,
Map<WorkerSlot,WorkerResources> resources,
Map<String,Double> nodeIdToTotalSharedOffHeap)
Create a new assignment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assign(WorkerSlot slot,
Collection<ExecutorDetails> executors)
Deprecated.
|
void |
assign(WorkerSlot slot,
Collection<ExecutorDetails> executors,
WorkerResources slotResources)
Assign the slot to executors.
|
boolean |
equals(Object other) |
boolean |
equalsIgnoreResources(Object other)
Like the equals command, but ignores the resources.
|
Set<ExecutorDetails> |
getExecutors()
Get the set of all executors.
|
Map<ExecutorDetails,WorkerSlot> |
getExecutorToSlot()
Get the map of executor to WorkerSlot.
|
Map<String,Double> |
getNodeIdToTotalSharedOffHeapNodeMemory()
Get the total shared off heap node memory mapping.
|
Map<WorkerSlot,WorkerResources> |
getScheduledResources()
Get the slot to resource mapping.
|
Set<WorkerSlot> |
getSlots()
Get the set of all slots that are a part of this.
|
Map<WorkerSlot,Collection<ExecutorDetails>> |
getSlotToExecutors()
Get the mapping of slot to executors on that slot.
|
String |
getTopologyId()
Return the ID of the topology.
|
int |
hashCode() |
boolean |
isExecutorAssigned(ExecutorDetails executor)
Is the executor assigned or not.
|
boolean |
isSlotOccupied(WorkerSlot slot)
Is this slot part of this assignment or not.
|
void |
setTotalSharedOffHeapNodeMemory(String node,
double value) |
String |
toString() |
void |
unassignBySlot(WorkerSlot slot)
Release the slot occupied by this assignment.
|
public SchedulerAssignmentImpl(String topologyId, Map<ExecutorDetails,WorkerSlot> executorToSlot, Map<WorkerSlot,WorkerResources> resources, Map<String,Double> nodeIdToTotalSharedOffHeap)
topologyId - the id of the topology the assignment is for.executorToSlot - the executor to slot mapping for the assignment. Can be null and set through other methods later.resources - the resources for the current assignments. Can be null and set through other methods later.nodeIdToTotalSharedOffHeap - the shared memory for this assignment can be null and set through other methods later.public SchedulerAssignmentImpl(String topologyId)
public SchedulerAssignmentImpl(SchedulerAssignment assignment)
public boolean equalsIgnoreResources(Object other)
other - the object to check for equality against.public Set<WorkerSlot> getSlots()
SchedulerAssignmentgetSlots in interface SchedulerAssignment@Deprecated public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors)
public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors, WorkerResources slotResources)
public void unassignBySlot(WorkerSlot slot)
public boolean isSlotOccupied(WorkerSlot slot)
SchedulerAssignmentisSlotOccupied in interface SchedulerAssignmentslot - the slot to check.public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignmentisExecutorAssigned in interface SchedulerAssignmentexecutor - the executor to check it if is assigned.public String getTopologyId()
SchedulerAssignmentgetTopologyId in interface SchedulerAssignmentpublic Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignmentgetExecutorToSlot in interface SchedulerAssignmentpublic Set<ExecutorDetails> getExecutors()
SchedulerAssignmentgetExecutors in interface SchedulerAssignmentpublic Map<WorkerSlot,Collection<ExecutorDetails>> getSlotToExecutors()
SchedulerAssignmentgetSlotToExecutors in interface SchedulerAssignmentpublic Map<WorkerSlot,WorkerResources> getScheduledResources()
SchedulerAssignmentgetScheduledResources in interface SchedulerAssignmentpublic void setTotalSharedOffHeapNodeMemory(String node, double value)
public Map<String,Double> getNodeIdToTotalSharedOffHeapNodeMemory()
SchedulerAssignmentgetNodeIdToTotalSharedOffHeapNodeMemory in interface SchedulerAssignmentCopyright © 2023 The Apache Software Foundation. All rights reserved.