public HealthReport checkHealth() { HealthCheckerExitStatus status = HealthCheckerExitStatus.SUCCESS; try { // Calling this execute leaves around running executor threads. shexec.execute(); } catch (ExitCodeException e) { // ignore the exit code of the script LOG.warn("Caught exception : " + e + ",exit code:" + e.getExitCode()); status = HealthCheckerExitStatus.FAILED_WITH_EXIT_CODE; } catch (IOException e) { LOG.warn("Caught exception : " + e); status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION; exceptionStackTrace = org.apache.hadoop.util.StringUtils.stringifyException(e); } finally { if (shexec.isTimedOut()) { status = HealthCheckerExitStatus.TIMED_OUT; } if (status == HealthCheckerExitStatus.SUCCESS) { if (hasErrors(shexec.getOutput())) { status = HealthCheckerExitStatus.FAILED; } } } return new HealthReport(status, getHealthReport(status)); }
public HealthReport checkHealth() { HealthCheckerExitStatus status = HealthCheckerExitStatus.SUCCESS; try { shexec.execute(); } catch (ExitCodeException e) { // ignore the exit code of the script LOG.warn("Caught exception : " + e); status = HealthCheckerExitStatus.FAILED_WITH_EXIT_CODE; } catch (IOException e) { LOG.warn("Caught exception : " + e); if (!shexec.isTimedOut()) { status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION; exceptionStackTrace = org.apache.hadoop.util.StringUtils.stringifyException(e); } else { status = HealthCheckerExitStatus.TIMED_OUT; } } finally { if (status == HealthCheckerExitStatus.SUCCESS) { if (hasErrors(shexec.getOutput())) { status = HealthCheckerExitStatus.FAILED; } } } return new HealthReport(status, getHealthReport(status)); }
public HealthReport checkHealth() { HealthCheckerExitStatus status = HealthCheckerExitStatus.SUCCESS; try { // Calling this execute leaves around running executor threads. shexec.execute(); } catch (ExitCodeException e) { // ignore the exit code of the script LOG.warn("Caught exception : " + e + ",exit code:" + e.getExitCode()); status = HealthCheckerExitStatus.FAILED_WITH_EXIT_CODE; } catch (IOException e) { LOG.warn("Caught exception : " + e); status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION; exceptionStackTrace = org.apache.hadoop.util.StringUtils.stringifyException(e); } finally { if (shexec.isTimedOut()) { status = HealthCheckerExitStatus.TIMED_OUT; } if (status == HealthCheckerExitStatus.SUCCESS) { if (hasErrors(shexec.getOutput())) { status = HealthCheckerExitStatus.FAILED; } } } return new HealthReport(status, getHealthReport(status)); }