@Override protected void chore() { HealthReport report = healthChecker.checkHealth(); boolean isHealthy = (report.getStatus() == HealthCheckerExitStatus.SUCCESS); if (!isHealthy) { boolean needToStop = decideToStop(); if (needToStop) { this.getStopper().stop("The node reported unhealthy " + threshold + " number of times consecutively."); } // Always log health report. LOG.info("Health status at " + StringUtils.formatTime(System.currentTimeMillis()) + " : " + report.getHealthReport()); } }
public void healthCheckerTest(String script, HealthCheckerExitStatus expectedStatus) throws Exception { Configuration config = getConfForNodeHealthScript(); config.addResource(healthScriptFile.getName()); String location = healthScriptFile.getAbsolutePath(); long timeout = config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT, SCRIPT_TIMEOUT); HealthChecker checker = new HealthChecker(); checker.init(location, timeout); createScript(script, true); HealthReport report = checker.checkHealth(); assertEquals(expectedStatus, report.getStatus()); LOG.info("Health Status:" + report.getHealthReport()); this.healthScriptFile.delete(); }
@Override protected void chore() { HealthReport report = healthChecker.checkHealth(); boolean isHealthy = (report.getStatus() == HealthCheckerExitStatus.SUCCESS); if (!isHealthy) { boolean needToStop = decideToStop(); if (needToStop) { this.stopper.stop("The region server reported unhealthy " + threshold + " number of times consecutively."); } // Always log health report. LOG.info("Health status at " + StringUtils.formatTime(System.currentTimeMillis()) + " : " + report.getHealthReport()); } }
@Override protected void chore() { HealthReport report = healthChecker.checkHealth(); boolean isHealthy = (report.getStatus() == HealthCheckerExitStatus.SUCCESS); if (!isHealthy) { boolean needToStop = decideToStop(); if (needToStop) { getStopper().stop( "The node reported unhealthy " + threshold + " number of times consecutively."); } // Always log health report. LOG.info("Health status at " + StringUtils.formatTime(System.currentTimeMillis()) + " : " + report.getHealthReport()); } }
public void healthCheckerTest(String script, HealthCheckerExitStatus expectedStatus) throws Exception { Configuration config = getConfForNodeHealthScript(); config.addResource(healthScriptFile.getName()); String location = healthScriptFile.getAbsolutePath(); long timeout = config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT, SCRIPT_TIMEOUT); HealthChecker checker = new HealthChecker(); checker.init(location, timeout); createScript(script, true); HealthReport report = checker.checkHealth(); assertEquals(expectedStatus, report.getStatus()); LOG.info("Health Status:" + report.getHealthReport()); this.healthScriptFile.delete(); }