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)
Create a new assignment.
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)
Like the equals command, but ignores the resources.
other - the object to check for equality against.public Set<WorkerSlot> getSlots()
SchedulerAssignmentGet the set of all slots that are a part of this.
getSlots in interface SchedulerAssignment@Deprecated public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors)
public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors, WorkerResources slotResources)
Assign the slot to executors.
public void unassignBySlot(WorkerSlot slot)
Release the slot occupied by this assignment.
public boolean isSlotOccupied(WorkerSlot slot)
SchedulerAssignmentIs this slot part of this assignment or not.
isSlotOccupied in interface SchedulerAssignmentslot - the slot to check.public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignmentIs the executor assigned or not.
isExecutorAssigned in interface SchedulerAssignmentexecutor - the executor to check it if is assigned.public String getTopologyId()
SchedulerAssignmentReturn the ID of the topology.
getTopologyId in interface SchedulerAssignmentpublic Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignmentGet the map of executor to WorkerSlot.
getExecutorToSlot in interface SchedulerAssignmentpublic Set<ExecutorDetails> getExecutors()
SchedulerAssignmentGet the set of all executors.
getExecutors in interface SchedulerAssignmentpublic Map<WorkerSlot,Collection<ExecutorDetails>> getSlotToExecutors()
SchedulerAssignmentGet the mapping of slot to executors on that slot.
getSlotToExecutors in interface SchedulerAssignmentpublic Map<WorkerSlot,WorkerResources> getScheduledResources()
SchedulerAssignmentGet the slot to resource mapping.
getScheduledResources in interface SchedulerAssignmentpublic void setTotalSharedOffHeapNodeMemory(String node, double value)
public Map<String,Double> getNodeIdToTotalSharedOffHeapNodeMemory()
SchedulerAssignmentGet the total shared off heap node memory mapping.
getNodeIdToTotalSharedOffHeapNodeMemory in interface SchedulerAssignmentCopyright © 2021 The Apache Software Foundation. All rights reserved.