public 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 and Description |
|---|---|
static org.slf4j.Logger |
LOG |
static String |
SEPARATOR |
| Constructor and Description |
|---|
NodeHealthCheckerService(LocalDirsHandlerService dirHandlerService) |
| Modifier and Type | Method and Description |
|---|---|
LocalDirsHandlerService |
getDiskHandler() |
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(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 String SEPARATOR
public NodeHealthCheckerService(LocalDirsHandlerService dirHandlerService)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.CompositeServiceExceptionpublic String getHealthReport()
getHealthReport in interface HealthReporterpublic boolean isHealthy()
HealthReporterisHealthy in interface HealthReporterpublic long getLastHealthReportTime()
HealthReportergetLastHealthReportTime in interface HealthReporterpublic LocalDirsHandlerService getDiskHandler()
public void reportException(Exception exception)
ExceptionReporter.exception - the exception to propagateCopyright © 2008–2024 Apache Software Foundation. All rights reserved.