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 Type
    Method
    Description
    Returns output from health check.
    long
    Returns time stamp when node health check was last run.
    boolean
    Gets whether the node is healthy or not.
    void
    Method used to start the health monitoring.
    protected void
    Method used to terminate the health monitoring service.
    protected void
    setHealthy(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • serviceStart

      public void serviceStart() throws Exception
      Method used to start the health monitoring.
      Overrides:
      serviceStart in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStop

      protected void serviceStop() throws Exception
      Method used to terminate the health monitoring service.
      Overrides:
      serviceStop in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • isHealthy

      public boolean isHealthy()
      Description copied from interface: HealthReporter
      Gets whether the node is healthy or not.
      Specified by:
      isHealthy in interface HealthReporter
      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

      public String getHealthReport()
      Description copied from interface: HealthReporter
      Returns output from health check. If node is healthy then an empty string is returned.
      Specified by:
      getHealthReport in interface HealthReporter
      Returns:
      output from health check
    • getLastHealthReportTime

      public long getLastHealthReportTime()
      Description copied from interface: HealthReporter
      Returns time stamp when node health check was last run.
      Specified by:
      getLastHealthReportTime in interface HealthReporter
      Returns:
      timestamp when node health script was last run