Package org.apache.storm.scheduler
Class SchedulerAssignmentImpl
java.lang.Object
org.apache.storm.scheduler.SchedulerAssignmentImpl
- All Implemented Interfaces:
- SchedulerAssignment
- 
Constructor SummaryConstructorsConstructorDescriptionSchedulerAssignmentImpl(String topologyId) SchedulerAssignmentImpl(String topologyId, Map<ExecutorDetails, WorkerSlot> executorToSlot, Map<WorkerSlot, WorkerResources> resources, Map<String, Double> nodeIdToTotalSharedOffHeap) Create a new assignment.SchedulerAssignmentImpl(SchedulerAssignment assignment) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidassign(WorkerSlot slot, Collection<ExecutorDetails> executors) Deprecated.voidassign(WorkerSlot slot, Collection<ExecutorDetails> executors, WorkerResources slotResources) Assign the slot to executors.booleanbooleanequalsIgnoreResources(Object other) Like the equals command, but ignores the resources.Get the set of all executors.Get the map of executor to WorkerSlot.Get the total shared off heap node memory mapping.Get the slot to resource mapping.getSlots()Get the set of all slots that are a part of this.Get the mapping of slot to executors on that slot.Return the ID of the topology.inthashCode()booleanisExecutorAssigned(ExecutorDetails executor) Is the executor assigned or not.booleanisSlotOccupied(WorkerSlot slot) Is this slot part of this assignment or not.voidsetTotalSharedOffHeapNodeMemory(String node, double value) toString()voidunassignBySlot(WorkerSlot slot) Release the slot occupied by this assignment.
- 
Constructor Details- 
SchedulerAssignmentImplpublic SchedulerAssignmentImpl(String topologyId, Map<ExecutorDetails, WorkerSlot> executorToSlot, Map<WorkerSlot, WorkerResources> resources, Map<String, Double> nodeIdToTotalSharedOffHeap) Create a new assignment.- Parameters:
- 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.
 
- 
SchedulerAssignmentImpl
- 
SchedulerAssignmentImpl
 
- 
- 
Method Details- 
toString
- 
equalsIgnoreResourcesLike the equals command, but ignores the resources.- Parameters:
- other- the object to check for equality against.
- Returns:
- true if they are equal, ignoring resources, else false.
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getSlotsDescription copied from interface:SchedulerAssignmentGet the set of all slots that are a part of this.- Specified by:
- getSlotsin interface- SchedulerAssignment
- Returns:
- the set of all slots.
 
- 
assignDeprecated.
- 
assignpublic void assign(WorkerSlot slot, Collection<ExecutorDetails> executors, WorkerResources slotResources) Assign the slot to executors.
- 
unassignBySlotRelease the slot occupied by this assignment.
- 
isSlotOccupiedDescription copied from interface:SchedulerAssignmentIs this slot part of this assignment or not.- Specified by:
- isSlotOccupiedin interface- SchedulerAssignment
- Parameters:
- slot- the slot to check.
- Returns:
- true if the slot is occupied by this assignment else false.
 
- 
isExecutorAssignedDescription copied from interface:SchedulerAssignmentIs the executor assigned or not.- Specified by:
- isExecutorAssignedin interface- SchedulerAssignment
- Parameters:
- executor- the executor to check it if is assigned.
- Returns:
- true if it is assigned else false
 
- 
getTopologyIdDescription copied from interface:SchedulerAssignmentReturn the ID of the topology.- Specified by:
- getTopologyIdin interface- SchedulerAssignment
- Returns:
- the topology-id this assignment is for.
 
- 
getExecutorToSlotDescription copied from interface:SchedulerAssignmentGet the map of executor to WorkerSlot.- Specified by:
- getExecutorToSlotin interface- SchedulerAssignment
- Returns:
- the executor -> slot map.
 
- 
getExecutorsDescription copied from interface:SchedulerAssignmentGet the set of all executors.- Specified by:
- getExecutorsin interface- SchedulerAssignment
- Returns:
- the executors covered by this assignments
 
- 
getSlotToExecutorsDescription copied from interface:SchedulerAssignmentGet the mapping of slot to executors on that slot.- Specified by:
- getSlotToExecutorsin interface- SchedulerAssignment
- Returns:
- the slot to the executors assigned to that slot.
 
- 
getScheduledResourcesDescription copied from interface:SchedulerAssignmentGet the slot to resource mapping.- Specified by:
- getScheduledResourcesin interface- SchedulerAssignment
- Returns:
- The slot to resource mapping
 
 
-