Class DefaultPool
java.lang.Object
org.apache.storm.scheduler.multitenant.NodePool
org.apache.storm.scheduler.multitenant.DefaultPool
A pool of machines that anyone can use, but topologies are not isolated.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.storm.scheduler.multitenant.NodePool
NodePool.NodeAndSlotCounts, NodePool.RoundRobinSlotScheduler
-
Field Summary
Fields inherited from class org.apache.storm.scheduler.multitenant.NodePool
cluster, nodeIdToNode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a topology to the pool.boolean
Check if this topology can be added to this pool.getNodeAndSlotCountIfSlotsWereTaken
(int slotsNeeded) Get the number of nodes and slots this would provide to get the slots needed.int
Get the number of available nodes.void
scheduleAsNeeded
(NodePool... lesserPools) Reschedule any topologies as needed.int
Get number of available slots.takeNodes
(int nodesNeeded) Take up to nodesNeeded from this pool.takeNodesBySlots
(int slotsNeeded) Take nodes from this pool that can fulfill possibly up to the slotsNeeded.toString()
Methods inherited from class org.apache.storm.scheduler.multitenant.NodePool
getNodeCountIfSlotsWereTaken, init, nodesAvailable, slotsAvailable, takeNodes, takeNodesBySlot
-
Constructor Details
-
DefaultPool
public DefaultPool()
-
-
Method Details
-
addTopology
Description copied from class:NodePool
Add a topology to the pool.- Specified by:
addTopology
in classNodePool
- Parameters:
td
- the topology to add
-
canAdd
Description copied from class:NodePool
Check if this topology can be added to this pool. -
takeNodes
Description copied from class:NodePool
Take up to nodesNeeded from this pool. -
nodesAvailable
public int nodesAvailable()Description copied from class:NodePool
Get the number of available nodes.- Specified by:
nodesAvailable
in classNodePool
- Returns:
- the number of nodes that are available to be taken
-
slotsAvailable
public int slotsAvailable()Description copied from class:NodePool
Get number of available slots.- Specified by:
slotsAvailable
in classNodePool
- Returns:
- the number of slots that are available to be taken
-
getNodeAndSlotCountIfSlotsWereTaken
Description copied from class:NodePool
Get the number of nodes and slots this would provide to get the slots needed.- Specified by:
getNodeAndSlotCountIfSlotsWereTaken
in classNodePool
- Parameters:
slotsNeeded
- the number of slots needed- Returns:
- the number of nodes and slots that would be returned.
-
takeNodesBySlots
Description copied from class:NodePool
Take nodes from this pool that can fulfill possibly up to the slotsNeeded.- Specified by:
takeNodesBySlots
in classNodePool
- Parameters:
slotsNeeded
- the number of slots that are needed.- Returns:
- a Collection of nodes with the removed nodes in it. This may be empty, but should not be null.
-
scheduleAsNeeded
Description copied from class:NodePool
Reschedule any topologies as needed.- Specified by:
scheduleAsNeeded
in classNodePool
- Parameters:
lesserPools
- pools that may be used to steal nodes from.
-
toString
-