use of org.apache.hadoop.hbase.chaos.actions.Action in project hbase by apache.
the class MasterKillingMonkeyFactory method build.
@Override
public ChaosMonkey build() {
loadProperties();
// Destructive actions to mess things around.
Action[] actions1 = new Action[] { new RestartActiveMasterAction(restartActiveMasterSleepTime) };
// Action to log more info for debugging
Action[] actions2 = new Action[] { new DumpClusterStatusAction() };
return new PolicyBasedChaosMonkey(util, new PeriodicRandomActionPolicy(action1Period, actions1), new PeriodicRandomActionPolicy(action2Period, actions2));
}
use of org.apache.hadoop.hbase.chaos.actions.Action in project hbase by apache.
the class NoKillMonkeyFactory method build.
@Override
public ChaosMonkey build() {
Action[] actions1 = new Action[] { new CompactTableAction(tableName, MonkeyConstants.DEFAULT_PERIODIC_ACTION1_PERIOD), new CompactRandomRegionOfTableAction(tableName, MonkeyConstants.DEFAULT_COMPACT_RANDOM_REGION_RATIO), new FlushTableAction(tableName), new FlushRandomRegionOfTableAction(tableName), new MoveRandomRegionOfTableAction(tableName) };
Action[] actions2 = new Action[] { new SplitRandomRegionOfTableAction(tableName), new MergeRandomAdjacentRegionsOfTableAction(tableName), new SnapshotTableAction(tableName), new AddColumnAction(tableName), new RemoveColumnAction(tableName, columnFamilies), new ChangeEncodingAction(tableName), new ChangeCompressionAction(tableName), new ChangeBloomFilterAction(tableName), new ChangeVersionsAction(tableName) };
Action[] actions3 = new Action[] { new MoveRegionsOfTableAction(MonkeyConstants.DEFAULT_MOVE_REGIONS_SLEEP_TIME, MonkeyConstants.DEFAULT_MOVE_REGIONS_MAX_TIME, tableName), new MoveRandomRegionOfTableAction(MonkeyConstants.DEFAULT_RESTART_ACTIVE_MASTER_SLEEP_TIME, tableName) };
Action[] actions4 = new Action[] { new DumpClusterStatusAction() };
return new PolicyBasedChaosMonkey(util, new TwoConcurrentActionPolicy(MonkeyConstants.DEFAULT_PERIODIC_ACTION1_PERIOD, actions1, actions2), new PeriodicRandomActionPolicy(MonkeyConstants.DEFAULT_PERIODIC_ACTION2_PERIOD, actions3), new PeriodicRandomActionPolicy(MonkeyConstants.DEFAULT_PERIODIC_ACTION4_PERIOD, actions4));
}
use of org.apache.hadoop.hbase.chaos.actions.Action in project hbase by apache.
the class ServerAndDependenciesKillingMonkeyFactory method build.
@Override
public ChaosMonkey build() {
// Destructive actions to mess things around. Cannot run batch restart.
Action[] actions1 = new Action[] { new RestartRandomRsExceptMetaAction(60000), new RestartActiveMasterAction(5000), // only allow 2 servers to be dead.
new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), new ForceBalancerAction(), new RestartRandomDataNodeAction(60000), new RestartRandomZKNodeAction(60000) };
// Action to log more info for debugging
Action[] actions2 = new Action[] { new DumpClusterStatusAction() };
return new PolicyBasedChaosMonkey(util, new CompositeSequentialPolicy(new DoActionsOncePolicy(60 * 1000, actions1), new PeriodicRandomActionPolicy(60 * 1000, actions1)), new PeriodicRandomActionPolicy(60 * 1000, actions2));
}
use of org.apache.hadoop.hbase.chaos.actions.Action in project hbase by apache.
the class ServerKillingMonkeyFactory method build.
@Override
public ChaosMonkey build() {
// Destructive actions to mess things around. Cannot run batch restart
Action[] actions1 = new Action[] { new RestartRandomRsExceptMetaAction(60000), new RestartActiveMasterAction(5000), //only allow 2 servers to be dead
new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), new ForceBalancerAction() };
// Action to log more info for debugging
Action[] actions2 = new Action[] { new DumpClusterStatusAction() };
return new PolicyBasedChaosMonkey(util, new CompositeSequentialPolicy(new DoActionsOncePolicy(60 * 1000, actions1), new PeriodicRandomActionPolicy(60 * 1000, actions1)), new PeriodicRandomActionPolicy(60 * 1000, actions2));
}
use of org.apache.hadoop.hbase.chaos.actions.Action in project hbase by apache.
the class TwoConcurrentActionPolicy method runOneIteration.
@Override
protected void runOneIteration() {
Action actionOne = PolicyBasedChaosMonkey.selectRandomItem(actionsOne);
Action actionTwo = PolicyBasedChaosMonkey.selectRandomItem(actionsTwo);
Future fOne = executor.submit(new ActionRunner(actionOne));
Future fTwo = executor.submit(new ActionRunner(actionTwo));
try {
fOne.get();
fTwo.get();
} catch (InterruptedException e) {
LOG.warn("Exception occurred during performing action: " + StringUtils.stringifyException(e));
} catch (ExecutionException ex) {
LOG.warn("Exception occurred during performing action: " + StringUtils.stringifyException(ex));
}
}
Aggregations