View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.chaos.factories;
19  
20  import java.util.Arrays;
21  import java.util.HashSet;
22  import java.util.Set;
23  
24  public interface MonkeyConstants {
25  
26    public static final String PERIODIC_ACTION1_PERIOD = "sdm.action1.period";
27    public static final String PERIODIC_ACTION2_PERIOD = "sdm.action2.period";
28    public static final String PERIODIC_ACTION4_PERIOD = "sdm.action4.period";
29    public static final String COMPOSITE_ACTION3_PERIOD = "sdm.action3.period";
30    public static final String MOVE_REGIONS_MAX_TIME = "move.regions.max.time";
31    public static final String MOVE_REGIONS_SLEEP_TIME = "move.regions.sleep.time";
32    public static final String MOVE_RANDOM_REGION_SLEEP_TIME = "move.randomregion.sleep.time";
33    public static final String RESTART_RANDOM_RS_SLEEP_TIME = "restart.random.rs.sleep.time";
34    public static final String BATCH_RESTART_RS_SLEEP_TIME = "batch.restart.rs.sleep.time";
35    public static final String BATCH_RESTART_RS_RATIO = "batch.restart.rs.ratio";
36    public static final String RESTART_ACTIVE_MASTER_SLEEP_TIME = "restart.active.master.sleep.time";
37    public static final String ROLLING_BATCH_RESTART_RS_SLEEP_TIME = "rolling.batch.restart.rs.sleep.time";
38    public static final String ROLLING_BATCH_RESTART_RS_RATIO = "rolling.batch.restart.rs.ratio";
39    public static final String RESTART_RS_HOLDING_META_SLEEP_TIME = "restart.rs.holding.meta.sleep.time";
40    public static final String COMPACT_TABLE_ACTION_RATIO = "compact.table.ratio";
41    public static final String COMPACT_RANDOM_REGION_RATIO = "compact.random.region.ratio";
42    public static final String UNBALANCE_CHAOS_EVERY_MS = "unbalance.chaos.period";
43    public static final String UNBALANCE_WAIT_FOR_UNBALANCE_MS = "unbalance.action.wait.period";
44    public static final String UNBALANCE_WAIT_FOR_KILLS_MS = "unbalance.action.kill.period";
45    public static final String UNBALANCE_WAIT_AFTER_BALANCE_MS = "unbalance.action.wait.after.period";
46  
47    public static final long DEFAULT_PERIODIC_ACTION1_PERIOD = 60 * 1000;
48    public static final long DEFAULT_PERIODIC_ACTION2_PERIOD = 90 * 1000;
49    public static final long DEFAULT_PERIODIC_ACTION4_PERIOD = 90 * 1000;
50    public static final long DEFAULT_COMPOSITE_ACTION3_PERIOD = 150 * 1000;
51    public static final long DEFAULT_MOVE_REGIONS_MAX_TIME = 10 * 60 * 1000;
52    public static final long DEFAULT_MOVE_REGIONS_SLEEP_TIME = 800;
53    public static final long DEFAULT_MOVE_RANDOM_REGION_SLEEP_TIME = 800;
54    public static final long DEFAULT_RESTART_RANDOM_RS_SLEEP_TIME = 60000;
55    public static final long DEFAULT_BATCH_RESTART_RS_SLEEP_TIME = 5000;
56    public static final float DEFAULT_BATCH_RESTART_RS_RATIO = 0.5f;
57    public static final long DEFAULT_RESTART_ACTIVE_MASTER_SLEEP_TIME = 5000;
58    public static final long DEFAULT_ROLLING_BATCH_RESTART_RS_SLEEP_TIME = 5000;
59    public static final float DEFAULT_ROLLING_BATCH_RESTART_RS_RATIO = 1.0f;
60    public static final long DEFAULT_RESTART_RS_HOLDING_META_SLEEP_TIME = 35000;
61    public static final float DEFAULT_COMPACT_TABLE_ACTION_RATIO = 0.5f;
62    public static final float DEFAULT_COMPACT_RANDOM_REGION_RATIO = 0.6f;
63    public static final long DEFAULT_UNBALANCE_CHAOS_EVERY_MS = 65 * 1000;
64    public static final long DEFAULT_UNBALANCE_WAIT_FOR_UNBALANCE_MS = 2 * 1000;
65    public static final long DEFAULT_UNBALANCE_WAIT_FOR_KILLS_MS = 2 * 1000;
66    public static final long DEFAULT_UNBALANCE_WAIT_AFTER_BALANCE_MS = 5 * 1000;
67  
68    /**
69     * A Set of prefixes which encompasses all of the configuration properties for the ChaosMonky.
70     */
71    Set<String> MONKEY_CONFIGURATION_KEY_PREFIXES = new HashSet<>(
72        Arrays.asList("sdm.", "move.", "restart.", "batch.", "rolling.", "compact.",
73            "unbalance.", "decrease."));
74  }