public abstract class TimedHealthReporterService extends org.apache.hadoop.service.AbstractService implements HealthReporter
HealthReporter
skeleton for regularly checking a specific
TimerTask
and obtaining information about it.NodeHealthScriptRunner
Modifier and Type | Method and Description |
---|---|
String |
getHealthReport()
Returns output from health check.
|
long |
getLastHealthReportTime()
Returns time stamp when node health check was last run.
|
boolean |
isHealthy()
Gets whether the node is healthy or not.
|
void |
serviceStart()
Method used to start the health monitoring.
|
protected void |
serviceStop()
Method used to terminate the health monitoring service.
|
protected void |
setHealthy(boolean healthy)
Sets if the node is healthy or not.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public boolean isHealthy()
HealthReporter
isHealthy
in interface HealthReporter
protected void setHealthy(boolean healthy)
healthy
- whether the node is healthypublic String getHealthReport()
HealthReporter
getHealthReport
in interface HealthReporter
public long getLastHealthReportTime()
HealthReporter
getLastHealthReportTime
in interface HealthReporter
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.