Brooklyn

brooklyn.policy.loadbalancing
[Java] Class BalancingStrategy

java.lang.Object
  brooklyn.policy.loadbalancing.BalancingStrategy

public class BalancingStrategy

Represents an abstract algorithm for optimally balancing worker "items" among several "containers" based on the workloads of the items, and corresponding high- and low-thresholds on the containers. TODO: extract interface, provide default implementation TODO: remove legacy code comments


Constructor Summary
BalancingStrategy(java.lang.String name, BalanceablePoolModel model)

 
Method Summary
protected boolean balanceItemsOnColdNode(NodeType questionedNode, double questionedNodeTotalWorkrate, boolean gonnaGrow)

protected boolean balanceItemsOnHotNode(NodeType node, double nodeWorkrate, boolean gonnaGrow)

protected boolean balanceItemsOnNodesInQuestion(NodeType questionedNode, boolean gonnaGrow)

protected ItemType findBestItemToMove(java.util.Map costsPerItem, double targetCost, double maxCost, double maxCostIfNothingSmallerButLarger, java.util.Set excludedItems, Location locationIfKnown)

"Best" is defined as nearest to the targetCost, without exceeding maxCost, unless maxCostIfNothingSmallerButLarger > 0 which does just that (useful if the ideal and target are estimates and aren't quite right, typically it will take something larger than maxRate but less than half the total rate, which is only possible when the estimates don't agree)

BalanceablePoolModel getDataProvider()

int getMaxMigrationsPerBalancingNode()

java.lang.String getName()

protected void moveItem(ItemType item, NodeType oldNode, NodeType newNode)

void rebalance()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

BalancingStrategy

public BalancingStrategy(java.lang.String name, BalanceablePoolModel model)


 
Method Detail

balanceItemsOnColdNode

protected boolean balanceItemsOnColdNode(NodeType questionedNode, double questionedNodeTotalWorkrate, boolean gonnaGrow)


balanceItemsOnHotNode

protected boolean balanceItemsOnHotNode(NodeType node, double nodeWorkrate, boolean gonnaGrow)


balanceItemsOnNodesInQuestion

protected boolean balanceItemsOnNodesInQuestion(NodeType questionedNode, boolean gonnaGrow)


findBestItemToMove

protected ItemType findBestItemToMove(java.util.Map costsPerItem, double targetCost, double maxCost, double maxCostIfNothingSmallerButLarger, java.util.Set excludedItems, Location locationIfKnown)
"Best" is defined as nearest to the targetCost, without exceeding maxCost, unless maxCostIfNothingSmallerButLarger > 0 which does just that (useful if the ideal and target are estimates and aren't quite right, typically it will take something larger than maxRate but less than half the total rate, which is only possible when the estimates don't agree)


getDataProvider

public BalanceablePoolModel getDataProvider()


getMaxMigrationsPerBalancingNode

public int getMaxMigrationsPerBalancingNode()


getName

public java.lang.String getName()


moveItem

protected void moveItem(ItemType item, NodeType oldNode, NodeType newNode)


rebalance

public void rebalance()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.