Class TimedHealthReporterService
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.nodemanager.health.TimedHealthReporterService
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service,HealthReporter
- Direct Known Subclasses:
NodeHealthScriptRunner
public abstract class TimedHealthReporterService
extends org.apache.hadoop.service.AbstractService
implements HealthReporter
A
HealthReporter skeleton for regularly checking a specific
TimerTask and obtaining information about it.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Method Summary
Modifier and TypeMethodDescriptionReturns output from health check.longReturns time stamp when node health check was last run.booleanGets whether the node is healthy or not.voidMethod used to start the health monitoring.protected voidMethod used to terminate the health monitoring service.protected voidsetHealthy(boolean healthy) Sets if the node is healthy or not.Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Method Details
-
serviceStart
Method used to start the health monitoring.- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStop
Method used to terminate the health monitoring service.- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
isHealthy
public boolean isHealthy()Description copied from interface:HealthReporterGets whether the node is healthy or not.- Specified by:
isHealthyin interfaceHealthReporter- Returns:
- true if node is healthy
-
setHealthy
protected void setHealthy(boolean healthy) Sets if the node is healthy or not.- Parameters:
healthy- whether the node is healthy
-
getHealthReport
Description copied from interface:HealthReporterReturns output from health check. If node is healthy then an empty string is returned.- Specified by:
getHealthReportin interfaceHealthReporter- Returns:
- output from health check
-
getLastHealthReportTime
public long getLastHealthReportTime()Description copied from interface:HealthReporterReturns time stamp when node health check was last run.- Specified by:
getLastHealthReportTimein interfaceHealthReporter- Returns:
- timestamp when node health script was last run
-