public class IsolatedPool extends NodePool
A pool of machines that can be used to run isolated topologies
NodePool.NodeAndSlotCounts, NodePool.RoundRobinSlotScheduler_cluster, _nodeIdToNode| Constructor and Description |
|---|
IsolatedPool(int maxNodes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTopology(TopologyDetails td)
Add a topology to the pool
|
boolean |
canAdd(TopologyDetails td)
Check if this topology can be added to this pool
|
NodePool.NodeAndSlotCounts |
getNodeAndSlotCountIfSlotsWereTaken(int slotsNeeded)
Get the number of nodes and slots this would provide to get the slots needed
|
int |
nodesAvailable() |
void |
scheduleAsNeeded(NodePool... lesserPools)
Reschedule any topologies as needed.
|
int |
slotsAvailable() |
Collection<Node> |
takeNodes(int nodesNeeded)
Take up to nodesNeeded from this pool
|
Collection<Node> |
takeNodesBySlots(int slotsNeeded)
Take nodes from this pool that can fulfill possibly up to the slotsNeeded
|
String |
toString() |
getNodeCountIfSlotsWereTaken, init, nodesAvailable, slotsAvailable, takeNodes, takeNodesBySlotpublic void addTopology(TopologyDetails td)
NodePoolAdd a topology to the pool
addTopology in class NodePooltd - the topology to add.public boolean canAdd(TopologyDetails td)
NodePoolCheck if this topology can be added to this pool
public void scheduleAsNeeded(NodePool... lesserPools)
NodePoolReschedule any topologies as needed.
scheduleAsNeeded in class NodePoollesserPools - pools that may be used to steal nodes from.public Collection<Node> takeNodes(int nodesNeeded)
NodePoolTake up to nodesNeeded from this pool
public int nodesAvailable()
nodesAvailable in class NodePoolpublic int slotsAvailable()
slotsAvailable in class NodePoolpublic Collection<Node> takeNodesBySlots(int slotsNeeded)
NodePoolTake nodes from this pool that can fulfill possibly up to the slotsNeeded
takeNodesBySlots in class NodePoolslotsNeeded - the number of slots that are needed.public NodePool.NodeAndSlotCounts getNodeAndSlotCountIfSlotsWereTaken(int slotsNeeded)
NodePoolGet the number of nodes and slots this would provide to get the slots needed
getNodeAndSlotCountIfSlotsWereTaken in class NodePoolslotsNeeded - the number of slots neededCopyright © 2019 The Apache Software Foundation. All rights reserved.