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  
19  package org.apache.hadoop.hbase.chaos;
20  
21  import org.apache.hadoop.hbase.classification.InterfaceAudience;
22  
23  /***
24   * ChaosConstant holds a bunch of Choas-related Constants
25   */
26  @InterfaceAudience.Public
27  public final class ChaosConstants {
28  
29    /*Base ZNode for whole Chaos Testing*/
30    public static final String CHAOS_TEST_ROOT_ZNODE = "/hbase";
31  
32    /*Just a / used for path separator*/
33    public static final String ZNODE_PATH_SEPARATOR = "/";
34  
35    /*ZNode used for ChaosAgents registration.*/
36    public static final String CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE =
37      CHAOS_TEST_ROOT_ZNODE + ZNODE_PATH_SEPARATOR + "chaosAgents";
38  
39    /*ZNode used for getting status of tasks assigned*/
40    public static final String CHAOS_AGENT_STATUS_PERSISTENT_ZNODE =
41      CHAOS_TEST_ROOT_ZNODE + ZNODE_PATH_SEPARATOR + "chaosAgentTaskStatus";
42  
43    /*Config property for getting number of retries to execute a command*/
44    public static final String RETRY_ATTEMPTS_KEY = "hbase.it.clustermanager.retry.attempts";
45  
46    /*Default value for number of retries*/
47    public static final int DEFAULT_RETRY_ATTEMPTS = 5;
48  
49    /*Config property to sleep in between retries*/
50    public static final String RETRY_SLEEP_INTERVAL_KEY =
51      "hbase.it.clustermanager.retry.sleep.interval";
52  
53    /*Default Sleep time between each retry*/
54    public static final int DEFAULT_RETRY_SLEEP_INTERVAL = 5000;
55  
56    /*Config property for executing command as specific user*/
57    public static final String CHAOSAGENT_SHELL_USER = "hbase.it.clustermanager.ssh.user";
58  
59    /*default user for executing local commands*/
60    public static final String DEFAULT_SHELL_USER = "";
61  
62    /*timeout used while creating ZooKeeper connection*/
63    public static final int SESSION_TIMEOUT_ZK = 60000 * 10;
64  
65    /*Time given to ChaosAgent to set status*/
66    public static final int SET_STATUS_SLEEP_TIME = 30 * 1000;
67  
68    /*Status String when you get an ERROR while executing task*/
69    public static final String TASK_ERROR_STRING = "error";
70  
71    /*Status String when your command gets executed correctly*/
72    public static final String TASK_COMPLETION_STRING = "done";
73  
74    /*Name of ChoreService to use*/
75    public static final String CHORE_SERVICE_PREFIX = "ChaosService";
76  
77  }