Java 类org.apache.hadoop.hbase.chaos.policies.PeriodicRandomActionPolicy 实例源码

项目:ditb    文件:MasterKillingMonkeyFactory.java   
@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));
}
项目:ditb    文件:ServerKillingMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Destructive actions to mess things around. Cannot run batch restart
  Action[] actions1 = new Action[] {
      new RestartRandomRsExceptMetaAction(60000),
      new RestartActiveMasterAction(5000),
      new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), //only allow 2 servers to be dead
      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));
}
项目:ditb    文件:ServerAndDependenciesKillingMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Destructive actions to mess things around. Cannot run batch restart.
  Action[] actions1 = new Action[]{
    new RestartRandomRsExceptMetaAction(60000),
    new RestartActiveMasterAction(5000),
    new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), // only allow 2 servers to be dead.
    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));
}
项目:hbase    文件:MasterKillingMonkeyFactory.java   
@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));
}
项目:hbase    文件:ServerKillingMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Destructive actions to mess things around. Cannot run batch restart
  Action[] actions1 = new Action[] {
      new RestartRandomRsExceptMetaAction(60000),
      new RestartActiveMasterAction(5000),
      new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), //only allow 2 servers to be dead
      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));
}
项目:hbase    文件:ServerAndDependenciesKillingMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Destructive actions to mess things around. Cannot run batch restart.
  Action[] actions1 = new Action[]{
    new RestartRandomRsExceptMetaAction(60000),
    new RestartActiveMasterAction(5000),
    new RollingBatchRestartRsExceptMetaAction(5000, 1.0f, 2), // only allow 2 servers to be dead.
    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));
}
项目:ditb    文件:NoKillMonkeyFactory.java   
@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));
}
项目:ditb    文件:UnbalanceMonkeyFactory.java   
@Override
public ChaosMonkey build() {
  loadProperties();
  Policy chaosPolicy = new PeriodicRandomActionPolicy(chaosEveryMilliSec,
      new UnbalanceKillAndRebalanceAction(waitForUnbalanceMilliSec, waitForKillMilliSec,
          waitAfterBalanceMilliSec));

  return new PolicyBasedChaosMonkey(util, chaosPolicy);
}
项目:ditb    文件:IntegrationTestRegionReplicaPerf.java   
@Override
public void setUpMonkey() throws Exception {
  Policy p = new PeriodicRandomActionPolicy(sleepTime,
    new RestartRandomRsExceptMetaAction(sleepTime),
    new MoveRandomRegionOfTableAction(tableName));
  this.monkey = new PolicyBasedChaosMonkey(util, p);
  // don't start monkey right away
}
项目:HIndex    文件:UnbalanceMonkeyFactory.java   
@Override
public ChaosMonkey build() {
  Policy chaosPolicy = new PeriodicRandomActionPolicy(
      CHAOS_EVERY_MS,
      new UnbalanceKillAndRebalanceAction()
  );

  return new PolicyBasedChaosMonkey(util, chaosPolicy);
}
项目:hbase    文件:NoKillMonkeyFactory.java   
@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));
}
项目:hbase    文件:MobNoKillMonkeyFactory.java   
@Override public ChaosMonkey build() {
  Action[] actions1 = new Action[] {
    new CompactMobAction(tableName, MonkeyConstants.DEFAULT_PERIODIC_ACTION1_PERIOD),
    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));
}
项目:hbase    文件:UnbalanceMonkeyFactory.java   
@Override
public ChaosMonkey build() {
  loadProperties();
  Policy chaosPolicy = new PeriodicRandomActionPolicy(chaosEveryMilliSec,
      new UnbalanceKillAndRebalanceAction(waitForUnbalanceMilliSec, waitForKillMilliSec,
          waitAfterBalanceMilliSec, killMetaRs));

  return new PolicyBasedChaosMonkey(util, chaosPolicy);
}
项目:hbase    文件:IntegrationTestRegionReplicaPerf.java   
@Override
public void setUpMonkey() throws Exception {
  Policy p = new PeriodicRandomActionPolicy(sleepTime,
    new RestartRandomRsExceptMetaAction(sleepTime),
    new MoveRandomRegionOfTableAction(tableName));
  this.monkey = new PolicyBasedChaosMonkey(util, p);
  // don't start monkey right away
}
项目:PyroDB    文件:UnbalanceMonkeyFactory.java   
@Override
public ChaosMonkey build() {
  Policy chaosPolicy = new PeriodicRandomActionPolicy(
      CHAOS_EVERY_MS,
      new UnbalanceKillAndRebalanceAction()
  );

  return new PolicyBasedChaosMonkey(util, chaosPolicy);
}
项目:ditb    文件:StressAssignmentManagerMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Actions that could slow down region movement.
  // These could also get regions stuck if there are issues.
  Action[] actions1 = new Action[]{
      new CompactTableAction(tableName, 0.5f),
      new CompactRandomRegionOfTableAction(tableName, 0.6f),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName)
  };

  Action[] actions2 = new Action[]{
      new SplitRandomRegionOfTableAction(tableName),
      new MergeRandomAdjacentRegionsOfTableAction(tableName),
      new AddColumnAction(tableName),
      new RemoveColumnAction(tableName, columnFamilies),
      new MoveRegionsOfTableAction(MonkeyConstants.DEFAULT_MOVE_REGIONS_SLEEP_TIME,
          1600,
          tableName),
      new MoveRandomRegionOfTableAction(MonkeyConstants.DEFAULT_MOVE_RANDOM_REGION_SLEEP_TIME,
          tableName),
      new RestartRandomRsAction(MonkeyConstants.DEFAULT_RESTART_RANDOM_RS_SLEEP_TIME),
      new BatchRestartRsAction(MonkeyConstants.DEFAULT_ROLLING_BATCH_RESTART_RS_SLEEP_TIME, 0.5f),
      new RollingBatchRestartRsAction(MonkeyConstants.DEFAULT_BATCH_RESTART_RS_SLEEP_TIME, 1.0f),
      new RestartRsHoldingMetaAction(MonkeyConstants.DEFAULT_RESTART_RS_HOLDING_META_SLEEP_TIME),
      new ChangeSplitPolicyAction(tableName),
      new SplitAllRegionOfTableAction(tableName),
      new DecreaseMaxHFileSizeAction(MonkeyConstants.DEFAULT_DECREASE_HFILE_SIZE_SLEEP_TIME,
          tableName),
  };

  // Action to log more info for debugging
  Action[] actions3 = new Action[]{
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(90 * 1000, actions1),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(90 * 1000, actions2),
          new PeriodicRandomActionPolicy(90 * 1000, actions2)),
      new PeriodicRandomActionPolicy(90 * 1000, actions3)
  );
}
项目:ditb    文件:SlowDeterministicMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  loadProperties();
  // Actions such as compact/flush a table/region,
  // move one region around. They are not so destructive,
  // can be executed more frequently.
  Action[] actions1 = new Action[] {
      new CompactTableAction(tableName, compactTableRatio),
      new CompactRandomRegionOfTableAction(tableName, compactRandomRegionRatio),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName),
      new MoveRandomRegionOfTableAction(tableName)
  };

  // Actions such as split/merge/snapshot.
  // They should not cause data loss, or unreliability
  // such as region stuck in transition.
  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),
      new ChangeSplitPolicyAction(tableName),
  };

  // Destructive actions to mess things around.
  Action[] actions3 = new Action[] {
      new MoveRegionsOfTableAction(moveRegionsSleepTime, moveRegionsMaxTime,
          tableName),
      new MoveRandomRegionOfTableAction(moveRandomRegionSleepTime, tableName),
      new RestartRandomRsAction(restartRandomRSSleepTime),
      new BatchRestartRsAction(batchRestartRSSleepTime, batchRestartRSRatio),
      new RestartActiveMasterAction(restartActiveMasterSleepTime),
      new RollingBatchRestartRsAction(rollingBatchRestartRSSleepTime,
          rollingBatchRestartRSRatio),
      new RestartRsHoldingMetaAction(restartRsHoldingMetaSleepTime),
      new DecreaseMaxHFileSizeAction(decreaseHFileSizeSleepTime, tableName),
      new SplitAllRegionOfTableAction(tableName),
  };

  // Action to log more info for debugging
  Action[] actions4 = new Action[] {
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(action1Period, actions1),
      new PeriodicRandomActionPolicy(action2Period, actions2),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(action3Period, actions3),
          new PeriodicRandomActionPolicy(action3Period, actions3)),
      new PeriodicRandomActionPolicy(action4Period, actions4));
}
项目:HIndex    文件:SlowDeterministicMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Actions such as compact/flush a table/region,
  // move one region around. They are not so destructive,
  // can be executed more frequently.
  Action[] actions1 = new Action[] {
      new CompactTableAction(tableName, 0.5f),
      new CompactRandomRegionOfTableAction(tableName, 0.6f),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName),
      new MoveRandomRegionOfTableAction(tableName)
  };

  // Actions such as split/merge/snapshot.
  // They should not cause data loss, or unreliability
  // such as region stuck in transition.
  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)
  };

  // Destructive actions to mess things around.
  Action[] actions3 = new Action[] {
      new MoveRegionsOfTableAction(800, tableName),
      new MoveRandomRegionOfTableAction(800, tableName),
      new RestartRandomRsAction(60000),
      new BatchRestartRsAction(5000, 0.5f),
      new RestartActiveMasterAction(5000),
      new RollingBatchRestartRsAction(5000, 1.0f),
      new RestartRsHoldingMetaAction(35000)
  };

  // Action to log more info for debugging
  Action[] actions4 = new Action[] {
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(60 * 1000, actions1),
      new PeriodicRandomActionPolicy(90 * 1000, actions2),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(150 * 1000, actions3),
          new PeriodicRandomActionPolicy(150 * 1000, actions3)),
      new PeriodicRandomActionPolicy(90 * 1000, actions4));
}
项目:hbase    文件:MobSlowDeterministicMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  loadProperties();
  // Actions such as compact/flush a table/region,
  // move one region around. They are not so destructive,
  // can be executed more frequently.
  Action[] actions1 = new Action[] {
          new CompactMobAction(tableName, compactTableRatio),
          new CompactTableAction(tableName, compactTableRatio),
          new CompactRandomRegionOfTableAction(tableName, compactRandomRegionRatio),
          new FlushTableAction(tableName),
          new FlushRandomRegionOfTableAction(tableName),
          new MoveRandomRegionOfTableAction(tableName)
  };

  // Actions such as split/merge/snapshot.
  // They should not cause data loss, or unreliability
  // such as region stuck in transition.
  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)
  };

  // Destructive actions to mess things around.
  Action[] actions3 = new Action[] {
          new MoveRegionsOfTableAction(moveRegionsSleepTime, moveRegionsMaxTime,
                  tableName),
          new MoveRandomRegionOfTableAction(moveRandomRegionSleepTime, tableName),
          new RestartRandomRsAction(restartRandomRSSleepTime),
          new BatchRestartRsAction(batchRestartRSSleepTime, batchRestartRSRatio),
          new RestartActiveMasterAction(restartActiveMasterSleepTime),
          new RollingBatchRestartRsAction(rollingBatchRestartRSSleepTime,
                  rollingBatchRestartRSRatio),
          new RestartRsHoldingMetaAction(restartRsHoldingMetaSleepTime)
  };

  // Action to log more info for debugging
  Action[] actions4 = new Action[] {
          new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
          new PeriodicRandomActionPolicy(action1Period, actions1),
          new PeriodicRandomActionPolicy(action2Period, actions2),
          new CompositeSequentialPolicy(
                  new DoActionsOncePolicy(action3Period, actions3),
                  new PeriodicRandomActionPolicy(action3Period, actions3)),
          new PeriodicRandomActionPolicy(action4Period, actions4));
}
项目:hbase    文件:StressAssignmentManagerMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Actions that could slow down region movement.
  // These could also get regions stuck if there are issues.
  Action[] actions1 = new Action[]{
      new CompactTableAction(tableName, 0.5f),
      new CompactRandomRegionOfTableAction(tableName, 0.6f),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName)
  };

  Action[] actions2 = new Action[]{
      new SplitRandomRegionOfTableAction(tableName),
      new MergeRandomAdjacentRegionsOfTableAction(tableName),
      new AddColumnAction(tableName),
      new RemoveColumnAction(tableName, columnFamilies),
      new MoveRegionsOfTableAction(MonkeyConstants.DEFAULT_MOVE_REGIONS_SLEEP_TIME,
          1600,
          tableName),
      new MoveRandomRegionOfTableAction(MonkeyConstants.DEFAULT_MOVE_RANDOM_REGION_SLEEP_TIME,
          tableName),
      new RestartRandomRsAction(MonkeyConstants.DEFAULT_RESTART_RANDOM_RS_SLEEP_TIME),
      new BatchRestartRsAction(MonkeyConstants.DEFAULT_ROLLING_BATCH_RESTART_RS_SLEEP_TIME, 0.5f),
      new RollingBatchRestartRsAction(MonkeyConstants.DEFAULT_BATCH_RESTART_RS_SLEEP_TIME, 1.0f),
      new RestartRsHoldingMetaAction(MonkeyConstants.DEFAULT_RESTART_RS_HOLDING_META_SLEEP_TIME),
      new ChangeSplitPolicyAction(tableName),
      new SplitAllRegionOfTableAction(tableName),
      new DecreaseMaxHFileSizeAction(MonkeyConstants.DEFAULT_DECREASE_HFILE_SIZE_SLEEP_TIME,
          tableName),
  };

  // Action to log more info for debugging
  Action[] actions3 = new Action[]{
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(90 * 1000, actions1),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(90 * 1000, actions2),
          new PeriodicRandomActionPolicy(90 * 1000, actions2)),
      new PeriodicRandomActionPolicy(90 * 1000, actions3)
  );
}
项目:hbase    文件:SlowDeterministicMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  loadProperties();
  // Actions such as compact/flush a table/region,
  // move one region around. They are not so destructive,
  // can be executed more frequently.
  Action[] actions1 = new Action[] {
      new CompactTableAction(tableName, compactTableRatio),
      new CompactRandomRegionOfTableAction(tableName, compactRandomRegionRatio),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName),
      new MoveRandomRegionOfTableAction(tableName)
  };

  // Actions such as split/merge/snapshot.
  // They should not cause data loss, or unreliability
  // such as region stuck in transition.
  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),
      new ChangeSplitPolicyAction(tableName),
  };

  // Destructive actions to mess things around.
  Action[] actions3 = new Action[] {
      new MoveRegionsOfTableAction(moveRegionsSleepTime, moveRegionsMaxTime,
          tableName),
      new MoveRandomRegionOfTableAction(moveRandomRegionSleepTime, tableName),
      new RestartRandomRsAction(restartRandomRSSleepTime),
      new BatchRestartRsAction(batchRestartRSSleepTime, batchRestartRSRatio),
      new RestartActiveMasterAction(restartActiveMasterSleepTime),
      new RollingBatchRestartRsAction(rollingBatchRestartRSSleepTime,
          rollingBatchRestartRSRatio),
      new RestartRsHoldingMetaAction(restartRsHoldingMetaSleepTime),
      new DecreaseMaxHFileSizeAction(decreaseHFileSizeSleepTime, tableName),
      new SplitAllRegionOfTableAction(tableName),
  };

  // Action to log more info for debugging
  Action[] actions4 = new Action[] {
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(action1Period, actions1),
      new PeriodicRandomActionPolicy(action2Period, actions2),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(action3Period, actions3),
          new PeriodicRandomActionPolicy(action3Period, actions3)),
      new PeriodicRandomActionPolicy(action4Period, actions4));
}
项目:PyroDB    文件:SlowDeterministicMonkeyFactory.java   
@Override
public ChaosMonkey build() {

  // Actions such as compact/flush a table/region,
  // move one region around. They are not so destructive,
  // can be executed more frequently.
  Action[] actions1 = new Action[] {
      new CompactTableAction(tableName, 0.5f),
      new CompactRandomRegionOfTableAction(tableName, 0.6f),
      new FlushTableAction(tableName),
      new FlushRandomRegionOfTableAction(tableName),
      new MoveRandomRegionOfTableAction(tableName)
  };

  // Actions such as split/merge/snapshot.
  // They should not cause data loss, or unreliability
  // such as region stuck in transition.
  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)
  };

  // Destructive actions to mess things around.
  Action[] actions3 = new Action[] {
      new MoveRegionsOfTableAction(800, tableName),
      new MoveRandomRegionOfTableAction(800, tableName),
      new RestartRandomRsAction(60000),
      new BatchRestartRsAction(5000, 0.5f),
      new RestartActiveMasterAction(5000),
      new RollingBatchRestartRsAction(5000, 1.0f),
      new RestartRsHoldingMetaAction(35000)
  };

  // Action to log more info for debugging
  Action[] actions4 = new Action[] {
      new DumpClusterStatusAction()
  };

  return new PolicyBasedChaosMonkey(util,
      new PeriodicRandomActionPolicy(60 * 1000, actions1),
      new PeriodicRandomActionPolicy(90 * 1000, actions2),
      new CompositeSequentialPolicy(
          new DoActionsOncePolicy(150 * 1000, actions3),
          new PeriodicRandomActionPolicy(150 * 1000, actions3)),
      new PeriodicRandomActionPolicy(90 * 1000, actions4));
}