private synchronized void setHealthStatus(boolean isHealthy, String output) { this.setHealthy(isHealthy); this.setHealthReport(output); }
private synchronized void setHealthStatus(boolean isHealthy, String output, long time) { this.setHealthStatus(isHealthy, output); this.setLastReportedTime(time); }
@Override protected void serviceInit(Configuration conf) throws Exception { if (NodeHealthScriptRunner.shouldRun(conf)) { nodeHealthScriptRunner = new NodeHealthScriptRunner(); addService(nodeHealthScriptRunner); } addService(dirsHandler); super.serviceInit(conf); }
/** * Method used to start the Node health monitoring. * */ @Override protected void serviceStart() throws Exception { // if health script path is not configured don't start the thread. if (!shouldRun(conf)) { LOG.info("Not starting node health monitor"); return; } nodeHealthScriptScheduler = new Timer("NodeHealthMonitor-Timer", true); // Start the timer task immediately and // then periodically at interval time. nodeHealthScriptScheduler.scheduleAtFixedRate(timer, 0, intervalTime); super.serviceStart(); }
/** * @return the reporting string of health of the node */ String getHealthReport() { String scriptReport = (nodeHealthScriptRunner == null) ? "" : nodeHealthScriptRunner.getHealthReport(); if (scriptReport.equals("")) { return dirsHandler.getDisksHealthReport(false); } else { return scriptReport.concat(SEPARATOR + dirsHandler.getDisksHealthReport(false)); } }
/** * @return <em>true</em> if the node is healthy */ boolean isHealthy() { boolean scriptHealthStatus = (nodeHealthScriptRunner == null) ? true : nodeHealthScriptRunner.isHealthy(); return scriptHealthStatus && dirsHandler.areDisksHealthy(); }
/** * @return when the last time the node health status is reported */ long getLastHealthReportTime() { long diskCheckTime = dirsHandler.getLastDisksCheckTime(); long lastReportTime = (nodeHealthScriptRunner == null) ? diskCheckTime : Math.max(nodeHealthScriptRunner.getLastReportedTime(), diskCheckTime); return lastReportTime; }
@Override protected void serviceInit(Configuration conf) throws Exception { if (NodeHealthScriptRunner.shouldRun(conf)) { nodeHealthScriptRunner = new NodeHealthScriptRunner(); addService(nodeHealthScriptRunner); } addService(dirsHandler); super.serviceInit(conf); }
/** * Method used to start the Node health monitoring. * */ @Override protected void serviceStart() throws Exception { // if health script path is not configured don't start the thread. if (!shouldRun(conf)) { LOG.info("Not starting node health monitor"); return; } nodeHealthScriptScheduler = new Timer("NodeHealthMonitor-Timer", true); // Start the timer task immediately and // then periodically at interval time. nodeHealthScriptScheduler.scheduleAtFixedRate(timer, 0, intervalTime); super.serviceStart(); }
/** * @return the reporting string of health of the node */ String getHealthReport() { String scriptReport = (nodeHealthScriptRunner == null) ? "" : nodeHealthScriptRunner.getHealthReport(); if (scriptReport.equals("")) { return dirsHandler.getDisksHealthReport(false); } else { return scriptReport.concat(SEPARATOR + dirsHandler.getDisksHealthReport(false)); } }
/** * @return <em>true</em> if the node is healthy */ boolean isHealthy() { boolean scriptHealthStatus = (nodeHealthScriptRunner == null) ? true : nodeHealthScriptRunner.isHealthy(); return scriptHealthStatus && dirsHandler.areDisksHealthy(); }
/** * @return when the last time the node health status is reported */ long getLastHealthReportTime() { long diskCheckTime = dirsHandler.getLastDisksCheckTime(); long lastReportTime = (nodeHealthScriptRunner == null) ? diskCheckTime : Math.max(nodeHealthScriptRunner.getLastReportedTime(), diskCheckTime); return lastReportTime; }
private synchronized void setHealthStatus(boolean isHealthy, String output, long time) { this.setHealthStatus(isHealthy, output); this.setLastReportedTime(time); }
private synchronized void setHealthStatus(boolean isHealthy, String output) { this.setHealthy(isHealthy); this.setHealthReport(output); }
/** * Method used to terminate the node health monitoring service. * */ @Override protected void serviceStop() { if (!shouldRun(conf)) { return; } if (nodeHealthScriptScheduler != null) { nodeHealthScriptScheduler.cancel(); } if (shexec != null) { Process p = shexec.getProcess(); if (p != null) { p.destroy(); } } }
/** * Method used to terminate the node health monitoring service. * */ @Override protected void serviceStop() { if (!shouldRun(conf)) { return; } if (nodeHealthScriptScheduler != null) { nodeHealthScriptScheduler.cancel(); } if (shexec != null) { Process p = shexec.getProcess(); if (p != null) { p.destroy(); } } }