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    String PERIODIC_ACTION1_PERIOD = "sdm.action1.period";
27    String PERIODIC_ACTION2_PERIOD = "sdm.action2.period";
28    String PERIODIC_ACTION4_PERIOD = "sdm.action4.period";
29    String COMPOSITE_ACTION3_PERIOD = "sdm.action3.period";
30    String MOVE_REGIONS_MAX_TIME = "move.regions.max.time";
31    String MOVE_REGIONS_SLEEP_TIME = "move.regions.sleep.time";
32    String MOVE_RANDOM_REGION_SLEEP_TIME = "move.randomregion.sleep.time";
33    String RESTART_RANDOM_RS_SLEEP_TIME = "restart.random.rs.sleep.time";
34    String BATCH_RESTART_RS_SLEEP_TIME = "batch.restart.rs.sleep.time";
35    String BATCH_RESTART_RS_RATIO = "batch.restart.rs.ratio";
36    String RESTART_ACTIVE_MASTER_SLEEP_TIME = "restart.active.master.sleep.time";
37    String ROLLING_BATCH_RESTART_RS_SLEEP_TIME = "rolling.batch.restart.rs.sleep.time";
38    String ROLLING_BATCH_RESTART_RS_RATIO = "rolling.batch.restart.rs.ratio";
39    String RESTART_RS_HOLDING_META_SLEEP_TIME = "restart.rs.holding.meta.sleep.time";
40    String COMPACT_TABLE_ACTION_RATIO = "compact.table.ratio";
41    String COMPACT_RANDOM_REGION_RATIO = "compact.random.region.ratio";
42    String UNBALANCE_CHAOS_EVERY_MS = "unbalance.chaos.period";
43    String UNBALANCE_WAIT_FOR_UNBALANCE_MS = "unbalance.action.wait.period";
44    String UNBALANCE_WAIT_FOR_KILLS_MS = "unbalance.action.kill.period";
45    String UNBALANCE_WAIT_AFTER_BALANCE_MS = "unbalance.action.wait.after.period";
46    String UNBALANCE_KILL_META_RS = "unbalance.action.kill.meta.rs";
47    String DECREASE_HFILE_SIZE_SLEEP_TIME = "decrease.hfile.size.sleep.time";
48  
49    /**
50     * A Set of prefixes which encompasses all of the configuration properties for the ChaosMonky.
51     */
52    Set<String> MONKEY_CONFIGURATION_KEY_PREFIXES = new HashSet<>(
53        Arrays.asList("sdm.", "move.", "restart.", "batch.", "rolling.", "compact.",
54            "unbalance.", "decrease."));
55  
56    long DEFAULT_PERIODIC_ACTION1_PERIOD = 60 * 1000;
57    long DEFAULT_PERIODIC_ACTION2_PERIOD = 90 * 1000;
58    long DEFAULT_PERIODIC_ACTION4_PERIOD = 90 * 1000;
59    long DEFAULT_COMPOSITE_ACTION3_PERIOD = 150 * 1000;
60    long DEFAULT_MOVE_REGIONS_MAX_TIME = 10 * 60 * 1000;
61    long DEFAULT_MOVE_REGIONS_SLEEP_TIME = 800;
62    long DEFAULT_MOVE_RANDOM_REGION_SLEEP_TIME = 800;
63    long DEFAULT_RESTART_RANDOM_RS_SLEEP_TIME = 60000;
64    long DEFAULT_BATCH_RESTART_RS_SLEEP_TIME = 5000;
65    float DEFAULT_BATCH_RESTART_RS_RATIO = 0.5f;
66    long DEFAULT_RESTART_ACTIVE_MASTER_SLEEP_TIME = 5000;
67    long DEFAULT_ROLLING_BATCH_RESTART_RS_SLEEP_TIME = 5000;
68    float DEFAULT_ROLLING_BATCH_RESTART_RS_RATIO = 1.0f;
69    long DEFAULT_RESTART_RS_HOLDING_META_SLEEP_TIME = 35000;
70    float DEFAULT_COMPACT_TABLE_ACTION_RATIO = 0.5f;
71    float DEFAULT_COMPACT_RANDOM_REGION_RATIO = 0.6f;
72    long DEFAULT_UNBALANCE_CHAOS_EVERY_MS = 65 * 1000;
73    long DEFAULT_UNBALANCE_WAIT_FOR_UNBALANCE_MS = 2 * 1000;
74    long DEFAULT_UNBALANCE_WAIT_FOR_KILLS_MS = 2 * 1000;
75    long DEFAULT_UNBALANCE_WAIT_AFTER_BALANCE_MS = 5 * 1000;
76    boolean DEFAULT_UNBALANCE_KILL_META_RS = true;
77    long DEFAULT_DECREASE_HFILE_SIZE_SLEEP_TIME = 30 * 1000;
78  }