public void run() {
    LOG.info("Request directory " + requestIdDir);
    hostStatus = new ArrayList<>();
    if (hosts == null) {
      return;
    }
    File done;
    File log;
    LOG.info("HostList for polling on " + hosts);
    for (String host : hosts) {
      /* Read through the files and gather output */
      BSHostStatus status = new BSHostStatus();
      status.setHostName(host);
      done = new File(requestIdDir, host + doneFileFilter);
      log = new File(requestIdDir, host + logFileFilter);
      if (LOG.isDebugEnabled()) {
        LOG.debug("Polling bootstrap status for host, requestDir={}, host={}, doneFileExists={}, logFileExists={}", requestIdDir, host, done.exists(), log.exists());
      }
      if (!done.exists()) {
        status.setStatus("RUNNING");
      } else {
        status.setStatus("FAILED");
        try {
          String statusCode = FileUtils.readFileToString(done, Charset.defaultCharset()).trim();
          if (statusCode.equals("0")) {
            status.setStatus("DONE");
          }
          
          updateStatus(status, statusCode);
        } catch (IOException e) {
          LOG.info("Error reading done file " + done);
        }
      }
      if (!log.exists()) {
        status.setLog("");
      } else {
        String logString = "";
        BufferedReader reader = null;
        try {
          StringBuilder sb = new StringBuilder();
          reader = new BufferedReader(new FileReader(log));

          String line = null;
          while (null != (line = reader.readLine())) {
            if (line.startsWith("tcgetattr:") || line.startsWith("tput:"))
              continue;

            if (0 != sb.length() || 0 == line.length())
              sb.append('\n');

            if (-1 != line.indexOf ("\\n"))
              sb.append(line.replace("\\n", "\n"));
            else
              sb.append(line);
          }
          
          logString = sb.toString();
        } catch (IOException e) {
          LOG.info("Error reading log file " + log +
                  ". Log file may be have not created yet");
        } finally {
          Closeables.closeSilently(reader);
        }
        status.setLog(logString);
      }
      hostStatus.add(status);
    }
  }
Runnable class that gets the hoststatus output by looking at the files
in a certain directory. Only meant to be useful for bootstrap as of now.
ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSHostStatusCollector.java