backtype.storm.scheduler
Class SchedulerAssignmentImpl

java.lang.Object
  extended by backtype.storm.scheduler.SchedulerAssignmentImpl
All Implemented Interfaces:
SchedulerAssignment

public class SchedulerAssignmentImpl
extends java.lang.Object
implements SchedulerAssignment


Constructor Summary
SchedulerAssignmentImpl(java.lang.String topologyId, java.util.Map<ExecutorDetails,WorkerSlot> executorToSlots)
           
 
Method Summary
 void assign(WorkerSlot slot, java.util.Collection<ExecutorDetails> executors)
          Assign the slot to executors.
 java.util.Set<ExecutorDetails> getExecutors()
          Return the executors covered by this assignments
 java.util.Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
          get the executor -> slot map.
 java.lang.String getTopologyId()
          get the topology-id this assignment is for.
 boolean isExecutorAssigned(ExecutorDetails executor)
          is the executor assigned?
 boolean isSlotOccupied(WorkerSlot slot)
          Does this slot occupied by this assignment?
 void unassignBySlot(WorkerSlot slot)
          Release the slot occupied by this assignment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerAssignmentImpl

public SchedulerAssignmentImpl(java.lang.String topologyId,
                               java.util.Map<ExecutorDetails,WorkerSlot> executorToSlots)
Method Detail

assign

public void assign(WorkerSlot slot,
                   java.util.Collection<ExecutorDetails> executors)
Assign the slot to executors.

Parameters:
slot -
executors -

unassignBySlot

public void unassignBySlot(WorkerSlot slot)
Release the slot occupied by this assignment.

Parameters:
slot -

isSlotOccupied

public boolean isSlotOccupied(WorkerSlot slot)
Does this slot occupied by this assignment?

Specified by:
isSlotOccupied in interface SchedulerAssignment
Parameters:
slot -
Returns:

isExecutorAssigned

public boolean isExecutorAssigned(ExecutorDetails executor)
Description copied from interface: SchedulerAssignment
is the executor assigned?

Specified by:
isExecutorAssigned in interface SchedulerAssignment
Returns:

getTopologyId

public java.lang.String getTopologyId()
Description copied from interface: SchedulerAssignment
get the topology-id this assignment is for.

Specified by:
getTopologyId in interface SchedulerAssignment
Returns:

getExecutorToSlot

public java.util.Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
Description copied from interface: SchedulerAssignment
get the executor -> slot map.

Specified by:
getExecutorToSlot in interface SchedulerAssignment
Returns:

getExecutors

public java.util.Set<ExecutorDetails> getExecutors()
Return the executors covered by this assignments

Specified by:
getExecutors in interface SchedulerAssignment
Returns: