public class LoadBalancingPolicy<NodeType extends Entity,ItemType extends Movable> extends AbstractPolicy
Policy that is attached to a pool of "containers", each of which can host one or more migratable "items". The policy monitors the workrates of the items and effects migrations in an attempt to ensure that the containers are all sufficiently utilized without any of them being overloaded.
The particular sensor that defines the items' workrates is specified when the policy is constructed. High- and
low-thresholds are defined as configuration keys on each of the container entities in the pool:
for an item sensor named foo.bar.sensorName, the corresponding container config keys would be named
foo.bar.sensorName.threshold.low and foo.bar.sensorName.threshold.high.
In addition to balancing items among the available containers, this policy causes the pool Entity to emit
POOL_COLD and POOL_HOT events when it is determined that there is a surplus or shortfall
of container resource in the pool respectively. These events may be consumed by a separate policy that is capable
of resizing the container pool.
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternalHIGHLIGHT_NAME_LAST_ACTION, HIGHLIGHT_NAME_LAST_CONFIRMATION, HIGHLIGHT_NAME_LAST_VIOLATION, HIGHLIGHT_NAME_TRIGGERS| Constructor and Description |
|---|
LoadBalancingPolicy() |
LoadBalancingPolicy(AttributeSensor<? extends java.lang.Number> metric,
BalanceablePoolModel<NodeType,ItemType> model) |
LoadBalancingPolicy(java.util.Map props,
AttributeSensor<? extends java.lang.Number> metric,
BalanceablePoolModel<NodeType,ItemType> model) |
| Modifier and Type | Method and Description |
|---|---|
void |
resume()
Resume the policy
|
void |
setEntity(EntityLocal entity) |
void |
suspend()
Suspend the policy
|
java.lang.String |
toString() |
destroy, getPolicyType, getRebindSupport, isRunning, isSuspended, relationsconfig, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, setDisplayName, setHighlights, subscriptions, tagsaddSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, init, rebind, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemIdequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHighlights, getUniqueTag, isDestroyedgetCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tagsconfig, getConfigaddSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemIdpublic LoadBalancingPolicy()
public LoadBalancingPolicy(AttributeSensor<? extends java.lang.Number> metric, BalanceablePoolModel<NodeType,ItemType> model)
public LoadBalancingPolicy(java.util.Map props,
AttributeSensor<? extends java.lang.Number> metric,
BalanceablePoolModel<NodeType,ItemType> model)
public void setEntity(EntityLocal entity)
setEntity in class AbstractEntityAdjunctpublic void suspend()
Policysuspend in interface Policysuspend in class AbstractPolicypublic void resume()
Policyresume in interface Policyresume in class AbstractPolicypublic java.lang.String toString()
toString in class AbstractPolicy