Class NodeHealthCheckerService
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.nodemanager.health.NodeHealthCheckerService
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service,HealthReporter
public class NodeHealthCheckerService
extends org.apache.hadoop.service.CompositeService
implements HealthReporter
This class provides functionality of checking the health of a node and
reporting back to the service for which the health checker has been asked to
report.
It is a
CompositeService: every Service must be registered
first in serviceInit, and should also implement the HealthReporter
interface - otherwise an exception is thrown.
Calling functions of HealthReporter merge its dependent
services' reports.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsFields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionJoining the health reports of the dependent services.longReturns time stamp when node health check was last run.booleanGets whether the node is healthy or not.voidreportException(Exception exception) Propagating an exception toExceptionReporter.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceStart, serviceStopMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
SEPARATOR
- See Also:
-
-
Constructor Details
-
NodeHealthCheckerService
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
getHealthReport
Joining the health reports of the dependent services.- Specified by:
getHealthReportin interfaceHealthReporter- Returns:
- the report string about the health of the node
-
isHealthy
public boolean isHealthy()Description copied from interface:HealthReporterGets whether the node is healthy or not.- Specified by:
isHealthyin interfaceHealthReporter- Returns:
- true if the node is healthy
-
getLastHealthReportTime
public long getLastHealthReportTime()Description copied from interface:HealthReporterReturns time stamp when node health check was last run.- Specified by:
getLastHealthReportTimein interfaceHealthReporter- Returns:
- when the last time the node health status is reported
-
getDiskHandler
- Returns:
- the disk handler
-
reportException
Propagating an exception toExceptionReporter.- Parameters:
exception- the exception to propagate
-