001/** 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.apache.hadoop.hbase.chaos.factories; 019 020import java.util.Arrays; 021import java.util.HashSet; 022import java.util.Set; 023 024public interface MonkeyConstants { 025 026 String PERIODIC_ACTION1_PERIOD = "sdm.action1.period"; 027 String PERIODIC_ACTION2_PERIOD = "sdm.action2.period"; 028 String PERIODIC_ACTION4_PERIOD = "sdm.action4.period"; 029 String COMPOSITE_ACTION3_PERIOD = "sdm.action3.period"; 030 String MOVE_REGIONS_MAX_TIME = "move.regions.max.time"; 031 String MOVE_REGIONS_SLEEP_TIME = "move.regions.sleep.time"; 032 String MOVE_RANDOM_REGION_SLEEP_TIME = "move.randomregion.sleep.time"; 033 String RESTART_RANDOM_RS_SLEEP_TIME = "restart.random.rs.sleep.time"; 034 String BATCH_RESTART_RS_SLEEP_TIME = "batch.restart.rs.sleep.time"; 035 String BATCH_RESTART_RS_RATIO = "batch.restart.rs.ratio"; 036 String RESTART_ACTIVE_MASTER_SLEEP_TIME = "restart.active.master.sleep.time"; 037 String ROLLING_BATCH_RESTART_RS_SLEEP_TIME = "rolling.batch.restart.rs.sleep.time"; 038 String ROLLING_BATCH_RESTART_RS_RATIO = "rolling.batch.restart.rs.ratio"; 039 String RESTART_RS_HOLDING_META_SLEEP_TIME = "restart.rs.holding.meta.sleep.time"; 040 String COMPACT_TABLE_ACTION_RATIO = "compact.table.ratio"; 041 String COMPACT_RANDOM_REGION_RATIO = "compact.random.region.ratio"; 042 String UNBALANCE_CHAOS_EVERY_MS = "unbalance.chaos.period"; 043 String UNBALANCE_WAIT_FOR_UNBALANCE_MS = "unbalance.action.wait.period"; 044 String UNBALANCE_WAIT_FOR_KILLS_MS = "unbalance.action.kill.period"; 045 String UNBALANCE_WAIT_AFTER_BALANCE_MS = "unbalance.action.wait.after.period"; 046 String UNBALANCE_KILL_META_RS = "unbalance.action.kill.meta.rs"; 047 String DECREASE_HFILE_SIZE_SLEEP_TIME = "decrease.hfile.size.sleep.time"; 048 049 /** 050 * A Set of prefixes which encompasses all of the configuration properties for the ChaosMonky. 051 */ 052 Set<String> MONKEY_CONFIGURATION_KEY_PREFIXES = new HashSet<>( 053 Arrays.asList("sdm.", "move.", "restart.", "batch.", "rolling.", "compact.", 054 "unbalance.", "decrease.")); 055 056 long DEFAULT_PERIODIC_ACTION1_PERIOD = 60 * 1000; 057 long DEFAULT_PERIODIC_ACTION2_PERIOD = 90 * 1000; 058 long DEFAULT_PERIODIC_ACTION4_PERIOD = 90 * 1000; 059 long DEFAULT_COMPOSITE_ACTION3_PERIOD = 150 * 1000; 060 long DEFAULT_MOVE_REGIONS_MAX_TIME = 10 * 60 * 1000; 061 long DEFAULT_MOVE_REGIONS_SLEEP_TIME = 800; 062 long DEFAULT_MOVE_RANDOM_REGION_SLEEP_TIME = 800; 063 long DEFAULT_RESTART_RANDOM_RS_SLEEP_TIME = 60000; 064 long DEFAULT_BATCH_RESTART_RS_SLEEP_TIME = 5000; 065 float DEFAULT_BATCH_RESTART_RS_RATIO = 0.5f; 066 long DEFAULT_RESTART_ACTIVE_MASTER_SLEEP_TIME = 5000; 067 long DEFAULT_ROLLING_BATCH_RESTART_RS_SLEEP_TIME = 5000; 068 float DEFAULT_ROLLING_BATCH_RESTART_RS_RATIO = 1.0f; 069 long DEFAULT_RESTART_RS_HOLDING_META_SLEEP_TIME = 35000; 070 float DEFAULT_COMPACT_TABLE_ACTION_RATIO = 0.5f; 071 float DEFAULT_COMPACT_RANDOM_REGION_RATIO = 0.6f; 072 long DEFAULT_UNBALANCE_CHAOS_EVERY_MS = 65 * 1000; 073 long DEFAULT_UNBALANCE_WAIT_FOR_UNBALANCE_MS = 2 * 1000; 074 long DEFAULT_UNBALANCE_WAIT_FOR_KILLS_MS = 2 * 1000; 075 long DEFAULT_UNBALANCE_WAIT_AFTER_BALANCE_MS = 5 * 1000; 076 boolean DEFAULT_UNBALANCE_KILL_META_RS = true; 077 long DEFAULT_DECREASE_HFILE_SIZE_SLEEP_TIME = 30 * 1000; 078}