public interface ScalingActionContext
ScalingActionListener
actionRequred method. From that method call, the scaling listener must return one of the
ScalingActionContext.ActionDecision
values. Scaling controller uses the instance of this interface to pass all relevant
information about the cause of the triggered action. The scaling listener should use the same instance of
the ScalingActionConext
object in response, indicating the listener's intent for the action.Modifier and Type | Interface and Description |
---|---|
static class |
ScalingActionContext.ActionDecision
The ActionDecision values are used by the scaling listener to inform the scaling controller the
listener's decision on the action.
|
static class |
ScalingActionContext.ActionReason
The ActionReason values identify the reason for the action.
|
static class |
ScalingActionContext.ActionType
The ActionType values are used to identify the type of action being triggered by the scaling
controller.
|
Modifier and Type | Method and Description |
---|---|
ScalingActionContext.ActionType |
getActionType()
This method returns the
ScalingActionContext.ActionType for the action event. |
java.util.List<ScalingObject> |
getCandidates()
This method returns the list of
ScalingObject candidates identified by the scaling controller
for the required action. |
java.lang.String |
getCluster()
This method returns the cluster name that requires the action.
|
java.lang.String |
getMetricType()
This method returns the metric type that requires the action when the action reason is
ScalingActionContext.ActionReason.SCALE_OUT . |
java.lang.String |
getPolicy()
This method returns the policy name that is applied to the cluster requiring the action.
|
ScalingActionContext.ActionReason |
getReason()
This method returns the
ScalingActionContext.ActionReason for the action event. |
double |
getValue()
This method returns the value of the metric that requires the action when the action reason is
ScalingActionContext.ActionReason.SCALE_OUT . |
void |
setDecisionTimeout(long duration,
java.util.concurrent.TimeUnit unit)
This methods sets the time that must elapse between scaling actions.
|
ScalingActionContext.ActionType getActionType()
ScalingActionContext.ActionType
for the action event.ScalingActionContext.ActionReason getReason()
ScalingActionContext.ActionReason
for the action event.java.lang.String getCluster()
java.lang.String getPolicy()
java.lang.String getMetricType()
ScalingActionContext.ActionReason.SCALE_OUT
.double getValue()
ScalingActionContext.ActionReason.SCALE_OUT
.java.util.List<ScalingObject> getCandidates()
ScalingObject
candidates identified by the scaling controller
for the required action. This list may be refined by scaling listener for a
ScalingActionContext.ActionDecision.CANDIDATE_SELECTED
action.void setDecisionTimeout(long duration, java.util.concurrent.TimeUnit unit)
ScalingActionContext.ActionReason.MIN
, ScalingActionContext.ActionReason.MAX
,
ScalingActionContext.ActionReason.SCALE_IN
or
ScalingActionContext.ActionReason.SCALE_OUT
.
The decision timeout is not respected when the subsequent action reason is
ScalingActionContext.ActionReason.REPLACEMENT_TO_MEET_MIN
or
ScalingActionContext.ActionReason.REPLACEMENT_TO_MEET_WORKLOAD
. ScalingController
,
the ScalingController
will not submit another scaling action to
the listener until the time period specified by the decision timeout has elapsed or the scaling
membership changes.duration
- The amount of time the scaling controller must wait before sending another scaling action to
the scaling listener.unit
- The time unit type specified in the duration parameter.