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()
SchedulerAssignment
Get 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)
SchedulerAssignment
Is this slot part of this assignment or not.
isSlotOccupied
in interface SchedulerAssignment
slot
- the slot to check.public boolean isExecutorAssigned(ExecutorDetails executor)
SchedulerAssignment
Is the executor assigned or not.
isExecutorAssigned
in interface SchedulerAssignment
executor
- the executor to check it if is assigned.public String getTopologyId()
SchedulerAssignment
Return the ID of the topology.
getTopologyId
in interface SchedulerAssignment
public Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
SchedulerAssignment
Get the map of executor to WorkerSlot.
getExecutorToSlot
in interface SchedulerAssignment
public Set<ExecutorDetails> getExecutors()
SchedulerAssignment
Get the set of all executors.
getExecutors
in interface SchedulerAssignment
public Map<WorkerSlot,Collection<ExecutorDetails>> getSlotToExecutors()
SchedulerAssignment
Get the mapping of slot to executors on that slot.
getSlotToExecutors
in interface SchedulerAssignment
public Map<WorkerSlot,WorkerResources> getScheduledResources()
SchedulerAssignment
Get the slot to resource mapping.
getScheduledResources
in interface SchedulerAssignment
public void setTotalSharedOffHeapNodeMemory(String node, double value)
public Map<String,Double> getNodeIdToTotalSharedOffHeapNodeMemory()
SchedulerAssignment
Get the total shared off heap node memory mapping.
getNodeIdToTotalSharedOffHeapNodeMemory
in interface SchedulerAssignment
Copyright © 2019 The Apache Software Foundation. All rights reserved.