private void recreateZKConnection() throws Exception {
    try {
      zk.close();
      createZKConnection(newTaskCreatedWatcher);
      createEphemeralZNode(ChaosConstants.CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE
        + ChaosConstants.ZNODE_PATH_SEPARATOR + agentName, new byte[0]);
    } catch (IOException e) {
      LOG.error("Error creating new ZK COnnection for agent: {}", agentName + e);
      throw e;
    }
  }
Below function executes command with retries with given user. Uses LocalShell to execute a
command.
@param user user name, default none
@param cmd  Command to execute
@return A pair of Exit Code and Shell output
@throws IOException Exception while executing shell command
hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosAgent.java