java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, HealthReporterpublic class NodeHealthCheckerService extends org.apache.hadoop.service.CompositeService implements HealthReporter
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.| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
|
static java.lang.String |
SEPARATOR |
| Constructor | Description |
|---|---|
NodeHealthCheckerService(LocalDirsHandlerService dirHandlerService) |
| Modifier and Type | Method | Description |
|---|---|---|
LocalDirsHandlerService |
getDiskHandler() |
|
java.lang.String |
getHealthReport() |
Joining the health reports of the dependent services.
|
long |
getLastHealthReportTime() |
Returns time stamp when node health check was last run.
|
boolean |
isHealthy() |
Gets whether the node is healthy or not.
|
void |
reportException(java.lang.Exception exception) |
Propagating an exception to
ExceptionReporter. |
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
addIfService, addService, getServices, removeService, serviceStart, serviceStopclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final org.slf4j.Logger LOG
public static final java.lang.String SEPARATOR
public NodeHealthCheckerService(LocalDirsHandlerService dirHandlerService)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.CompositeServicejava.lang.Exceptionpublic java.lang.String getHealthReport()
getHealthReport in interface HealthReporterpublic boolean isHealthy()
HealthReporterisHealthy in interface HealthReporterpublic long getLastHealthReportTime()
HealthReportergetLastHealthReportTime in interface HealthReporterpublic LocalDirsHandlerService getDiskHandler()
public void reportException(java.lang.Exception exception)
ExceptionReporter.exception - the exception to propagateCopyright © 2008–2025 Apache Software Foundation. All rights reserved.