Class Node
java.lang.Object
org.apache.storm.scheduler.multitenant.Node
Represents a single node in the cluster.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<Node>
Used to sort a list of nodes so the node with the most free slots comes first. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assign
(String topId, Collection<ExecutorDetails> executors, Cluster cluster) Assign a free slot on the node to the following topology and executors.static int
countFreeSlotsAlive
(Collection<Node> nodes) static int
countSlotsUsed
(String topId, Collection<Node> nodes) static int
countSlotsUsed
(Collection<Node> nodes) static int
countTotalSlotsAlive
(Collection<Node> nodes) boolean
void
free
(WorkerSlot ws, Cluster cluster, boolean forceFree) Frees a single slot in this node.void
freeAllSlots
(Cluster cluster) Free all slots on this node.void
freeTopology
(String topId, Cluster cluster) Frees all the slots for a topology.getAllNodesFrom
(Cluster cluster) getId()
Get running topologies.int
hashCode()
boolean
isAlive()
boolean
toString()
int
int
int
int
totalSlotsUsed
(String topId)
-
Field Details
-
FREE_NODE_COMPARATOR_DEC
Used 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
-
isAlive
public boolean isAlive() -
getRunningTopologies
Get running topologies.- Returns:
- a collection of the topology ids currently running on this node
-
isTotallyFree
public boolean isTotallyFree() -
totalSlotsFree
public int totalSlotsFree() -
totalSlotsUsed
public int totalSlotsUsed() -
totalSlotsUsed
-
totalSlots
public int totalSlots() -
freeAllSlots
Free all slots on this node. This will update the Cluster too.- Parameters:
cluster
- the cluster to be updated
-
free
Frees a single slot in this node.- Parameters:
ws
- the slot to freecluster
- the cluster to update
-
freeTopology
Frees all the slots for a topology.- Parameters:
topId
- the topology to free slots forcluster
- the cluster to update
-
assign
Assign 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
-
hashCode
public int hashCode() -
toString
-