backtype.storm.scheduler
Class SchedulerAssignmentImpl

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

public class SchedulerAssignmentImpl
extends Object
implements SchedulerAssignment


Constructor Summary
SchedulerAssignmentImpl(String topologyId, Map<ExecutorDetails,WorkerSlot> executorToSlots)
           
 
Method Summary
 void assign(WorkerSlot slot, Collection<ExecutorDetails> executors)
          Assign the slot to executors.
 Set<ExecutorDetails> getExecutors()
          Return the executors covered by this assignments
 Map<ExecutorDetails,WorkerSlot> getExecutorToSlot()
          get the executor -> slot map.
 Set<WorkerSlot> getSlots()
           
 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(String topologyId,
                               Map<ExecutorDetails,WorkerSlot> executorToSlots)
Method Detail

getSlots

public Set<WorkerSlot> getSlots()
Specified by:
getSlots in interface SchedulerAssignment

assign

public void assign(WorkerSlot slot,
                   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 String getTopologyId()
Description copied from interface: SchedulerAssignment
get the topology-id this assignment is for.

Specified by:
getTopologyId in interface SchedulerAssignment
Returns:

getExecutorToSlot

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

Specified by:
getExecutorToSlot in interface SchedulerAssignment
Returns:

getExecutors

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

Specified by:
getExecutors in interface SchedulerAssignment
Returns:


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.