public class AutoScalerPolicy extends AbstractPolicy
Resizable
entity and dynamically adjusts its size in response to
emitted POOL_COLD
and POOL_HOT
events. Alternatively, the policy can be configured to
keep a given metric within a required range.
This policy does not itself determine whether the pool is hot or cold, but instead relies on these
events being emitted by the monitored entity itself, or by another policy that is attached to it; see,
for example, LoadBalancingPolicy
.)
Modifier and Type | Class and Description |
---|---|
static class |
AutoScalerPolicy.Builder |
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
HIGHLIGHT_NAME_LAST_ACTION, HIGHLIGHT_NAME_LAST_CONFIRMATION, HIGHLIGHT_NAME_LAST_VIOLATION, HIGHLIGHT_NAME_TRIGGERS
Constructor and Description |
---|
AutoScalerPolicy() |
AutoScalerPolicy(java.util.Map<java.lang.String,?> props)
Deprecated.
since 0.12.0; use
PolicySpec |
Modifier and Type | Method and Description |
---|---|
static AutoScalerPolicy.Builder |
builder() |
int |
getResizeDownIterationIncrement() |
int |
getResizeDownIterationMax() |
int |
getResizeUpIterationIncrement() |
int |
getResizeUpIterationMax() |
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
void |
rebind()
Called by framework on rebind (in new-style instances):
after configuring, but
before the instance is managed, and
before adjuncts are attached to entities, and
before a reference to an object is shared.
|
void |
resume()
Resume the policy
|
void |
setEntity(EntityLocal entity) |
void |
setMaxPoolSize(int val) |
void |
setMetricLowerBound(java.lang.Number val) |
void |
setMetricUpperBound(java.lang.Number val) |
void |
setMinPeriodBetweenExecs(Duration val) |
void |
setMinPoolSize(int val) |
void |
setResizeDownIterationIncrement(java.lang.Integer val) |
void |
setResizeDownIterationMax(java.lang.Integer val) |
void |
setResizeDownStabilizationDelay(Duration val) |
void |
setResizeUpIterationIncrement(java.lang.Integer val) |
void |
setResizeUpIterationMax(java.lang.Integer val) |
void |
setResizeUpStabilizationDelay(Duration val) |
void |
suspend()
Suspend the policy
|
java.lang.String |
toString() |
destroy, getPolicyType, getRebindSupport, isRunning, isSuspended, relations
config, configure, getAdjunctType, getConfig, getDisplayName, getEntity, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, setDisplayName, setHighlights, subscriptions, tags
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemId
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHighlights, getUniqueTag, isDestroyed
getCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tags
config, getConfig
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public static BasicNotificationSensor<java.util.Map> DEFAULT_POOL_HOT_SENSOR
public static BasicNotificationSensor<java.util.Map> DEFAULT_POOL_COLD_SENSOR
public static BasicNotificationSensor<java.util.Map> DEFAULT_POOL_OK_SENSOR
public static BasicNotificationSensor<MaxPoolSizeReachedEvent> DEFAULT_MAX_SIZE_REACHED_SENSOR
builder.maxSizeReachedSensor(sensor)
.
Note that this "default" is not set automatically; the default is for no sensor to be used (so
no events emitted).public static final java.lang.String POOL_CURRENT_SIZE_KEY
public static final java.lang.String POOL_HIGH_THRESHOLD_KEY
public static final java.lang.String POOL_LOW_THRESHOLD_KEY
public static final java.lang.String POOL_CURRENT_WORKRATE_KEY
public static final ConfigKey<AttributeSensor<? extends java.lang.Number>> METRIC
public static final ConfigKey<java.lang.Number> METRIC_LOWER_BOUND
public static final ConfigKey<java.lang.Number> METRIC_UPPER_BOUND
public static final ConfigKey<java.lang.Integer> RESIZE_UP_ITERATION_INCREMENT
public static final ConfigKey<java.lang.Integer> RESIZE_UP_ITERATION_MAX
public static final ConfigKey<java.lang.Integer> RESIZE_DOWN_ITERATION_INCREMENT
public static final ConfigKey<java.lang.Integer> RESIZE_DOWN_ITERATION_MAX
public static final ConfigKey<Duration> RESIZE_DOWN_STABILIZATION_DELAY
public static final ConfigKey<java.lang.Integer> MIN_POOL_SIZE
public static final ConfigKey<java.lang.Integer> MAX_POOL_SIZE
public static final ConfigKey<java.lang.Integer> INSUFFICIENT_CAPACITY_HIGH_WATER_MARK
public static final ConfigKey<ResizeOperator> RESIZE_OPERATOR
public static final ConfigKey<<any>> CURRENT_SIZE_OPERATOR
public static final ConfigKey<BasicNotificationSensor<? extends java.util.Map>> POOL_HOT_SENSOR
public static final ConfigKey<BasicNotificationSensor<? extends java.util.Map>> POOL_COLD_SENSOR
public static final ConfigKey<BasicNotificationSensor<? extends java.util.Map>> POOL_OK_SENSOR
public static final ConfigKey<BasicNotificationSensor<? super MaxPoolSizeReachedEvent>> MAX_SIZE_REACHED_SENSOR
public AutoScalerPolicy()
@Deprecated public AutoScalerPolicy(java.util.Map<java.lang.String,?> props)
PolicySpec
public static AutoScalerPolicy.Builder builder()
public void init()
AbstractBrooklynObject
To preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
init
in class AbstractBrooklynObject
public void rebind()
AbstractBrooklynObject
AbstractBrooklynObject.init()
will not be called on rebind.
If you need to intercept behaviour after adjuncts are attached,
consider AbstractEntity.onManagementStarting()
(but probably worth raising a discussion on the mailing list!)
rebind
in class AbstractBrooklynObject
public void setMetricLowerBound(java.lang.Number val)
public void setMetricUpperBound(java.lang.Number val)
public int getResizeUpIterationIncrement()
public void setResizeUpIterationIncrement(java.lang.Integer val)
public int getResizeDownIterationIncrement()
public void setResizeDownIterationIncrement(java.lang.Integer val)
public int getResizeUpIterationMax()
public void setResizeUpIterationMax(java.lang.Integer val)
public int getResizeDownIterationMax()
public void setResizeDownIterationMax(java.lang.Integer val)
public void setMinPeriodBetweenExecs(Duration val)
public void setResizeUpStabilizationDelay(Duration val)
public void setResizeDownStabilizationDelay(Duration val)
public void setMinPoolSize(int val)
public void setMaxPoolSize(int val)
public void suspend()
Policy
suspend
in interface Policy
suspend
in class AbstractPolicy
public void resume()
Policy
resume
in interface Policy
resume
in class AbstractPolicy
public void setEntity(EntityLocal entity)
setEntity
in class AbstractEntityAdjunct
public java.lang.String toString()
toString
in class AbstractPolicy