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()
SchedulerAssignment
getSlots
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)
SchedulerAssignment
isSlotOccupied
in interface SchedulerAssignment
slot
- the slot to check.public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignment
isExecutorAssigned
in interface SchedulerAssignment
executor
- the executor to check it if is assigned.public String getTopologyId()
SchedulerAssignment
getTopologyId
in interface SchedulerAssignment
public Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignment
getExecutorToSlot
in interface SchedulerAssignment
public Set<ExecutorDetails> getExecutors()
SchedulerAssignment
getExecutors
in interface SchedulerAssignment
public Map<WorkerSlot,Collection<ExecutorDetails>> getSlotToExecutors()
SchedulerAssignment
getSlotToExecutors
in interface SchedulerAssignment
public Map<WorkerSlot,WorkerResources> getScheduledResources()
SchedulerAssignment
getScheduledResources
in interface SchedulerAssignment
public void setTotalSharedOffHeapNodeMemory(String node, double value)
public Map<String,Double> getNodeIdToTotalSharedOffHeapNodeMemory()
SchedulerAssignment
getNodeIdToTotalSharedOffHeapNodeMemory
in interface SchedulerAssignment
Copyright © 2023 The Apache Software Foundation. All rights reserved.