|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object backtype.storm.scheduler.Cluster
public class Cluster
Constructor Summary | |
---|---|
Cluster(java.util.Map<java.lang.String,SupervisorDetails> supervisors,
java.util.Map<java.lang.String,SchedulerAssignmentImpl> assignments)
|
Method Summary | |
---|---|
void |
assign(WorkerSlot slot,
java.lang.String topologyId,
java.util.Collection<ExecutorDetails> executors)
Assign the slot to the executors for this topology. |
void |
freeSlot(WorkerSlot slot)
Free the specified slot. |
void |
freeSlots(java.util.Collection<WorkerSlot> slots)
free the slots. |
int |
getAssignedNumWorkers(TopologyDetails topology)
Gets the number of workers assigned to this topology. |
SchedulerAssignment |
getAssignmentById(java.lang.String topologyId)
get the current assignment for the topology. |
java.util.Map<java.lang.String,SchedulerAssignment> |
getAssignments()
Get all the assignments. |
java.util.List<java.lang.Integer> |
getAvailablePorts(SupervisorDetails supervisor)
Return the available ports of this supervisor. |
java.util.List<WorkerSlot> |
getAvailableSlots()
Gets all the available slots in the cluster. |
java.util.List<WorkerSlot> |
getAvailableSlots(SupervisorDetails supervisor)
Return all the available slots on this supervisor. |
java.util.Map<java.lang.String,java.util.List<ExecutorDetails>> |
getNeedsSchedulingComponentToExecutors(TopologyDetails topology)
Gets a component-id -> executors map which needs scheduling in this topology. |
java.util.Map<ExecutorDetails,java.lang.String> |
getNeedsSchedulingExecutorToComponents(TopologyDetails topology)
Gets a executor -> component-id map which needs scheduling in this topology. |
SupervisorDetails |
getSupervisorById(java.lang.String nodeId)
Get a specific supervisor with the nodeId |
java.util.Map<java.lang.String,SupervisorDetails> |
getSupervisors()
Get all the supervisors. |
java.util.List<SupervisorDetails> |
getSupervisorsByHost(java.lang.String host)
Get all the supervisors on the specified host . |
java.util.Collection<ExecutorDetails> |
getUnassignedExecutors(TopologyDetails topology)
get the unassigned executors of the topology. |
java.util.List<java.lang.Integer> |
getUsedPorts(SupervisorDetails supervisor)
Get all the used ports of this supervisor. |
boolean |
isSlotOccupied(WorkerSlot slot)
Checks the specified slot is occupied. |
boolean |
needsScheduling(TopologyDetails topology)
Does the topology need scheduling? A topology needs scheduling if one of the following conditions holds: Although the topology is assigned slots, but is squeezed. |
java.util.List<TopologyDetails> |
needsSchedulingTopologies(Topologies topologies)
Gets all the topologies which needs scheduling. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cluster(java.util.Map<java.lang.String,SupervisorDetails> supervisors, java.util.Map<java.lang.String,SchedulerAssignmentImpl> assignments)
Method Detail |
---|
public java.util.List<TopologyDetails> needsSchedulingTopologies(Topologies topologies)
topologies
-
public boolean needsScheduling(TopologyDetails topology)
public java.util.Map<ExecutorDetails,java.lang.String> getNeedsSchedulingExecutorToComponents(TopologyDetails topology)
topology
-
public java.util.Map<java.lang.String,java.util.List<ExecutorDetails>> getNeedsSchedulingComponentToExecutors(TopologyDetails topology)
topology
-
public java.util.List<java.lang.Integer> getUsedPorts(SupervisorDetails supervisor)
cluster
-
public java.util.List<java.lang.Integer> getAvailablePorts(SupervisorDetails supervisor)
cluster
-
public java.util.List<WorkerSlot> getAvailableSlots(SupervisorDetails supervisor)
cluster
-
public java.util.Collection<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology)
public int getAssignedNumWorkers(TopologyDetails topology)
topology
-
public void assign(WorkerSlot slot, java.lang.String topologyId, java.util.Collection<ExecutorDetails> executors)
java.lang.RuntimeException
- if the specified slot is already occupied.public java.util.List<WorkerSlot> getAvailableSlots()
public void freeSlot(WorkerSlot slot)
slot
- public void freeSlots(java.util.Collection<WorkerSlot> slots)
slots
- public boolean isSlotOccupied(WorkerSlot slot)
slot
- the slot be to checked.
public SchedulerAssignment getAssignmentById(java.lang.String topologyId)
public SupervisorDetails getSupervisorById(java.lang.String nodeId)
nodeId
public java.util.List<SupervisorDetails> getSupervisorsByHost(java.lang.String host)
host
.
host
- hostname of the supervisor
SupervisorDetails
object.public java.util.Map<java.lang.String,SchedulerAssignment> getAssignments()
public java.util.Map<java.lang.String,SupervisorDetails> getSupervisors()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |