Class Node
java.lang.Object
org.apache.storm.scheduler.multitenant.Node
Represents a single node in the cluster.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Comparator<Node>Used to sort a list of nodes so the node with the most free slots comes first.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidassign(String topId, Collection<ExecutorDetails> executors, Cluster cluster) Assign a free slot on the node to the following topology and executors.static intcountFreeSlotsAlive(Collection<Node> nodes) static intcountSlotsUsed(String topId, Collection<Node> nodes) static intcountSlotsUsed(Collection<Node> nodes) static intcountTotalSlotsAlive(Collection<Node> nodes) booleanvoidfree(WorkerSlot ws, Cluster cluster, boolean forceFree) Frees a single slot in this node.voidfreeAllSlots(Cluster cluster) Free all slots on this node.voidfreeTopology(String topId, Cluster cluster) Frees all the slots for a topology.getAllNodesFrom(Cluster cluster) getId()Get running topologies.inthashCode()booleanisAlive()booleantoString()intintintinttotalSlotsUsed(String topId) 
- 
Field Details- 
FREE_NODE_COMPARATOR_DECUsed to sort a list of nodes so the node with the most free slots comes first.
 
- 
- 
Constructor Details- 
Node
 
- 
- 
Method Details- 
countSlotsUsed
- 
countSlotsUsed
- 
countFreeSlotsAlive
- 
countTotalSlotsAlive
- 
getAllNodesFrom
- 
getId
- 
isAlivepublic boolean isAlive()
- 
getRunningTopologiesGet running topologies.- Returns:
- a collection of the topology ids currently running on this node
 
- 
isTotallyFreepublic boolean isTotallyFree()
- 
totalSlotsFreepublic int totalSlotsFree()
- 
totalSlotsUsedpublic int totalSlotsUsed()
- 
totalSlotsUsed
- 
totalSlotspublic int totalSlots()
- 
freeAllSlotsFree all slots on this node. This will update the Cluster too.- Parameters:
- cluster- the cluster to be updated
 
- 
freeFrees a single slot in this node.- Parameters:
- ws- the slot to free
- cluster- the cluster to update
 
- 
freeTopologyFrees all the slots for a topology.- Parameters:
- topId- the topology to free slots for
- cluster- the cluster to update
 
- 
assignAssign a free slot on the node to the following topology and executors. This will update the cluster too.- Parameters:
- topId- the topology to assign a free slot to.
- executors- the executors to run in that slot.
- cluster- the cluster to be updated
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-