Package org.apache.hadoop.hbase
Class ChaosZKClient
java.lang.Object
org.apache.hadoop.hbase.ChaosZKClient
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
(package private) org.apache.zookeeper.AsyncCallback.DataCallback
private static final org.slf4j.Logger
private final String
private static final int
(package private) org.apache.zookeeper.AsyncCallback.StatCallback
(package private) org.apache.zookeeper.Watcher
Watcher to get notification whenever status of task changes.(package private) org.apache.zookeeper.AsyncCallback.StringCallback
private static final String
private static final String
private static final String
private static final String
private static final int
private static final String
(package private) org.apache.zookeeper.AsyncCallback.VoidCallback
private String
private org.apache.zookeeper.ZooKeeper
private static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates connection with ZooKeeperprivate void
deleteTask
(String path) Delete task after getting its statusprivate void
To get status of task submittedprivate boolean
isChaosAgentRunning
(String hostname) Checks if ChaosAgent is running or not on target host by checking its ZNode.private void
private void
setStatusWatch
(String name, ChaosZKClient.TaskObject taskObject) Set a watch on task submittedsubmitTask
(ChaosZKClient.TaskObject taskObject) Creates tasks for target hosts by creating ZNodes.
-
Field Details
-
LOG
-
CHAOS_AGENT_PARENT_ZNODE
- See Also:
-
CHAOS_AGENT_STATUS_ZNODE
- See Also:
-
ZNODE_PATH_SEPARATOR
- See Also:
-
TASK_PREFIX
- See Also:
-
TASK_ERROR_STRING
- See Also:
-
TASK_COMPLETION_STRING
- See Also:
-
TASK_BOOLEAN_TRUE
- See Also:
-
TASK_BOOLEAN_FALSE
- See Also:
-
CONNECTION_LOSS
- See Also:
-
SESSION_TIMEOUT_ZK
- See Also:
-
TASK_EXECUTION_TIMEOUT
- See Also:
-
taskStatus
-
quorum
-
zk
-
setStatusWatcher
org.apache.zookeeper.Watcher setStatusWatcherWatcher to get notification whenever status of task changes. -
getStatusCallback
org.apache.zookeeper.AsyncCallback.DataCallback getStatusCallback -
setStatusWatchCallback
org.apache.zookeeper.AsyncCallback.StatCallback setStatusWatchCallback -
submitTaskCallback
org.apache.zookeeper.AsyncCallback.StringCallback submitTaskCallback -
taskDeleteCallback
org.apache.zookeeper.AsyncCallback.VoidCallback taskDeleteCallback
-
-
Constructor Details
-
ChaosZKClient
-
-
Method Details
-
createNewZKConnection
Creates connection with ZooKeeper- Throws:
IOException
- when not able to create connection properly
-
isChaosAgentRunning
Checks if ChaosAgent is running or not on target host by checking its ZNode.- Parameters:
hostname
- hostname to check for chaosagent- Returns:
- true/false whether agent is running or not
-
submitTask
Creates tasks for target hosts by creating ZNodes. Waits for a limited amount of time to complete task to execute.- Parameters:
taskObject
- Object data represents command- Returns:
- returns status
-
getStatus
To get status of task submitted- Parameters:
path
- path at which to get statusctx
- path context
-
setStatusWatch
Set a watch on task submitted- Parameters:
name
- ZNode name to set a watchtaskObject
- context for ZNode name
-
deleteTask
Delete task after getting its status- Parameters:
path
- path to delete ZNode
-
recreateZKConnection
-