public class NodeHealthScriptRunner extends AbstractService
Service.STATE| Modifier and Type | Field and Description | 
|---|---|
static String | 
NODE_HEALTH_SCRIPT_TIMED_OUT_MSG
Time out error message 
 | 
| Constructor and Description | 
|---|
NodeHealthScriptRunner(String scriptName,
                      long chkInterval,
                      long timeout,
                      String[] scriptArgs)  | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
getHealthReport()
Returns output from health script. 
 | 
long | 
getLastReportedTime()
Returns time stamp when node health script was last run. 
 | 
TimerTask | 
getTimerTask()
Used only by tests to access the timer task directly 
 | 
boolean | 
isHealthy()
Gets the if the node is healthy or not 
 | 
protected void | 
serviceInit(Configuration conf)
All initialization code needed by a service. 
 | 
protected void | 
serviceStart()
Method used to start the Node health monitoring. 
 | 
protected void | 
serviceStop()
Method used to terminate the node health monitoring service. 
 | 
static boolean | 
shouldRun(String healthScript)
Method used to determine if or not node health monitoring service should be
 started or not. 
 | 
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final String NODE_HEALTH_SCRIPT_TIMED_OUT_MSG
protected void serviceInit(Configuration conf) throws Exception
AbstractServiceAbstractService.init(Configuration) prevents re-entrancy.
 The base implementation checks to see if the subclass has created
 a new configuration instance, and if so, updates the base class valueserviceInit in class AbstractServiceconf - configurationException - on a failure -these will be caught,
 possibly wrapped, and wil; trigger a service stopprotected void serviceStart()
                     throws Exception
serviceStart in class AbstractServiceException - if needed -these will be caught,
 wrapped, and trigger a service stopprotected void serviceStop()
serviceStop in class AbstractServicepublic boolean isHealthy()
public String getHealthReport()
public long getLastReportedTime()
public static boolean shouldRun(String healthScript)
public TimerTask getTimerTask()
Copyright © 2018 Apache Software Foundation. All Rights Reserved.