private <E extends Exception> void retryOrThrow(RetryCounter retryCounter, E ex, String hostname,
    String[] cmd) throws E {
    if (retryCounter.shouldRetry()) {
      LOG.warn("Remote command: " + StringUtils.join(cmd, " ") + " , hostname:" + hostname
        + " failed at attempt " + retryCounter.getAttemptTimes() + ". Retrying until maxAttempts: "
        + retryCounter.getMaxAttempts() + ". Exception: " + ex.getMessage());
      return;
    }
    throw ex;
  }
Execute the given command on the host using SSH
@return pair of exit code and command output
@throws IOException if something goes wrong.
hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java