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 */ 018 019package org.apache.hadoop.hbase.chaos; 020 021import org.apache.yetus.audience.InterfaceAudience; 022 023/*** 024 * ChaosConstant holds a bunch of Choas-related Constants 025 */ 026@InterfaceAudience.Public 027public final class ChaosConstants { 028 029 /*Base ZNode for whole Chaos Testing*/ 030 public static final String CHAOS_TEST_ROOT_ZNODE = "/hbase"; 031 032 /*Just a / used for path separator*/ 033 public static final String ZNODE_PATH_SEPARATOR = "/"; 034 035 /*ZNode used for ChaosAgents registration.*/ 036 public static final String CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE = 037 CHAOS_TEST_ROOT_ZNODE + ZNODE_PATH_SEPARATOR + "chaosAgents"; 038 039 /*ZNode used for getting status of tasks assigned*/ 040 public static final String CHAOS_AGENT_STATUS_PERSISTENT_ZNODE = 041 CHAOS_TEST_ROOT_ZNODE + ZNODE_PATH_SEPARATOR + "chaosAgentTaskStatus"; 042 043 /*Config property for getting number of retries to execute a command*/ 044 public static final String RETRY_ATTEMPTS_KEY = "hbase.it.clustermanager.retry.attempts"; 045 046 /*Default value for number of retries*/ 047 public static final int DEFAULT_RETRY_ATTEMPTS = 5; 048 049 /*Config property to sleep in between retries*/ 050 public static final String RETRY_SLEEP_INTERVAL_KEY = 051 "hbase.it.clustermanager.retry.sleep.interval"; 052 053 /*Default Sleep time between each retry*/ 054 public static final int DEFAULT_RETRY_SLEEP_INTERVAL = 5000; 055 056 /*Config property for executing command as specific user*/ 057 public static final String CHAOSAGENT_SHELL_USER = "hbase.it.clustermanager.ssh.user"; 058 059 /*default user for executing local commands*/ 060 public static final String DEFAULT_SHELL_USER = ""; 061 062 /*timeout used while creating ZooKeeper connection*/ 063 public static final int SESSION_TIMEOUT_ZK = 60000 * 10; 064 065 /*Time given to ChaosAgent to set status*/ 066 public static final int SET_STATUS_SLEEP_TIME = 30 * 1000; 067 068 /*Status String when you get an ERROR while executing task*/ 069 public static final String TASK_ERROR_STRING = "error"; 070 071 /*Status String when your command gets executed correctly*/ 072 public static final String TASK_COMPLETION_STRING = "done"; 073 074 /*Name of ChoreService to use*/ 075 public static final String CHORE_SERVICE_PREFIX = "ChaosService"; 076 077}