|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.policy.basic.AbstractEntityAdjunct
brooklyn.policy.basic.AbstractPolicy
brooklyn.policy.ha.ServiceReplacer
public class ServiceReplacer extends AbstractPolicy
attaches to a DynamicCluster and replaces a failed member in response to HASensors.ENTITY_FAILED or other sensor; if this fails, it sets the Cluster state to on-fire
Field Summary | |
---|---|
static BasicNotificationSensor |
ENTITY_REPLACEMENT_FAILED
|
static ConfigKey |
FAILURE_SENSOR_TO_MONITOR
monitors this sensor, by default ENTITY_RESTART_FAILED |
static ConfigKey |
FAIL_ON_NUM_RECURRING_FAILURES
skips replace if replacement has failed this many times failure re-occurs within this time interval |
static ConfigKey |
FAIL_ON_RECURRING_FAILURES_IN_THIS_DURATION
skips replace if replacement has failed this many times failure re-occurs within this time interval |
static ConfigKey |
SET_ON_FIRE_ON_FAILURE
|
static ConfigKey |
TICKER
|
protected java.util.List |
consecutiveReplacementFailureTimes
|
Fields inherited from class AbstractPolicy | |
---|---|
policyStatus, suspended |
Fields inherited from class AbstractEntityAdjunct | |
---|---|
_subscriptionTracker, adjunctType, configsInternal, entity, execution, id, leftoverProperties, name |
Constructor Summary | |
ServiceReplacer()
|
|
ServiceReplacer(java.util.Map flags)
|
|
ServiceReplacer(ConfigBag configBag)
|
|
ServiceReplacer(Sensor failureSensorToMonitor)
|
Method Summary | |
---|---|
protected long
|
currentTimeMillis()
|
protected void
|
onDetectedFailure(SensorEvent event)
|
protected void
|
onReplacementFailed(java.lang.String msg)
|
void
|
setEntity(EntityLocal entity)
|
Methods inherited from class AbstractPolicy | |
---|---|
destroy, getPolicyType, getRebindSupport, isRunning, isSuspended, resume, suspend, toString |
Field Detail |
---|
public static final BasicNotificationSensor ENTITY_REPLACEMENT_FAILED
@SuppressWarnings("rawtypes") public static final ConfigKeyFAILURE_SENSOR_TO_MONITOR = new BasicConfigKey (Sensor.class, "failureSensorToMonitor", "", ServiceRestarter.ENTITY_RESTART_FAILED); public static final ConfigKey FAILURE_SENSOR_TO_MONITOR
public static final ConfigKeyFAIL_ON_NUM_RECURRING_FAILURES = ConfigKeys.newIntegerConfigKey( public static final ConfigKey FAIL_ON_NUM_RECURRING_FAILURES
public static final ConfigKeyFAIL_ON_RECURRING_FAILURES_IN_THIS_DURATION = ConfigKeys.newLongConfigKey( public static final ConfigKey FAIL_ON_RECURRING_FAILURES_IN_THIS_DURATION
public static final ConfigKeySET_ON_FIRE_ON_FAILURE = ConfigKeys.newBooleanConfigKey("setOnFireOnFailure", "", true); public static final ConfigKey SET_ON_FIRE_ON_FAILURE
public static final ConfigKeyTICKER = ConfigKeys.newConfigKey(Ticker.class, public static final ConfigKey TICKER
protected final java.util.List consecutiveReplacementFailureTimes
Constructor Detail |
---|
public ServiceReplacer()
public ServiceReplacer(java.util.Map flags)
public ServiceReplacer(ConfigBag configBag)
public ServiceReplacer(Sensor failureSensorToMonitor)
Method Detail |
---|
protected long currentTimeMillis()
protected void onDetectedFailure(SensorEvent event)
protected void onReplacementFailed(java.lang.String msg)
checkArgument(entity instanceof DynamicCluster, "Replacer must take a DynamicCluster, not %s", entity); public void setEntity(EntityLocal entity)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.