Package org.apache.hadoop.hbase
Class ChaosZKClient
java.lang.Object
org.apache.hadoop.hbase.ChaosZKClient
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final String(package private) org.apache.zookeeper.AsyncCallback.DataCallbackprivate static final org.slf4j.Loggerprivate final Stringprivate static final int(package private) org.apache.zookeeper.AsyncCallback.StatCallback(package private) org.apache.zookeeper.WatcherWatcher to get notification whenever status of task changes.(package private) org.apache.zookeeper.AsyncCallback.StringCallbackprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final intprivate static final String(package private) org.apache.zookeeper.AsyncCallback.VoidCallbackprivate Stringprivate org.apache.zookeeper.ZooKeeperprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates connection with ZooKeeperprivate voiddeleteTask(String path) Delete task after getting its statusprivate voidTo get status of task submittedprivate booleanisChaosAgentRunning(String hostname) Checks if ChaosAgent is running or not on target host by checking its ZNode.private voidprivate voidsetStatusWatch(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
-