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